Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint and pretty #115

Merged
merged 3 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"env": {
"es2021": true
},
"extends": ["plugin:import/recommended", "airbnb-typescript/base", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
// required for "type-aware linting"
"project": ["./tsconfig.json"],
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["import", "@typescript-eslint"],
"settings": {
// resolves imports without file extensions for listed extensions
"import/resolver": {
"node": {
"extensions": [".ts"]
}
}
},
"rules": {
"comma-dangle": "off",
"@typescript-eslint/comma-dangle": "off",
"indent": "off",
"@typescript-eslint/indent": "off",
"import/order": [
"error",
{
"alphabetize": {
"order": "asc",
"caseInsensitive": false
}
}
],
// var rules
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/no-unused-vars": "warn",
// class rules
"@typescript-eslint/lines-between-class-members": "off"
}
}
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Please include the following information in your email:

If you prefer secure communication, please use the following GPG key:

https://keys.openpgp.org/search?q=security%40decent-dao.org
https://keys.openpgp.org/search?q=security%40decent-dao.org
37 changes: 37 additions & 0 deletions .github/workflows/code-syntax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Code Syntax
on:
push:
branches:
- develop
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Compile contracts
run: npm run compile
- name: Run linter
run: npm run lint:check
pretty:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Compile contracts
run: npm run compile
- name: Run prettier
run: npm run pretty:check
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
- run: npm clean-install
- run: npm publish
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
node-version-file: '.nvmrc'
- run: npm install
- run: npm run compile
- run: npm run test
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deployments/
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 100,
"endOfLine": "auto",
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"semi": true,
"arrowParens": "avoid",
"singleAttributePerLine": true
}
8 changes: 4 additions & 4 deletions deploy/core/001_deploy_ERC20Claim.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "ERC20Claim", []);
await deployNonUpgradeable(hre, 'ERC20Claim', []);
};

export default func;
8 changes: 4 additions & 4 deletions deploy/core/002_deploy_FractalModule.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "FractalModule", []);
await deployNonUpgradeable(hre, 'FractalModule', []);
};

export default func;
10 changes: 5 additions & 5 deletions deploy/core/003_deploy_FractalRegistry.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "FractalRegistry", []);
await deployNonUpgradeable(hre, 'FractalRegistry', []);
};

func.tags = ["FractalRegistry"];
func.tags = ['FractalRegistry'];

export default func;
8 changes: 4 additions & 4 deletions deploy/core/004_deploy_ERC20FreezeVoting.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "ERC20FreezeVoting", []);
await deployNonUpgradeable(hre, 'ERC20FreezeVoting', []);
};

export default func;
8 changes: 4 additions & 4 deletions deploy/core/005_deploy_MultisigFreezeVoting.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "MultisigFreezeVoting", []);
await deployNonUpgradeable(hre, 'MultisigFreezeVoting', []);
};

export default func;
8 changes: 4 additions & 4 deletions deploy/core/006_deploy_MultisigFreezeGuard.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "MultisigFreezeGuard", []);
await deployNonUpgradeable(hre, 'MultisigFreezeGuard', []);
};

export default func;
8 changes: 4 additions & 4 deletions deploy/core/007_deploy_AzoriusFreezeGuard.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "AzoriusFreezeGuard", []);
await deployNonUpgradeable(hre, 'AzoriusFreezeGuard', []);
};

export default func;
10 changes: 5 additions & 5 deletions deploy/core/008_deploy_Azorius.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "Azorius", []);
await deployNonUpgradeable(hre, 'Azorius', []);
};

func.tags = ["Azorius"];
func.tags = ['Azorius'];

export default func;
8 changes: 4 additions & 4 deletions deploy/core/009_deploy_VotesERC20.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "VotesERC20", []);
await deployNonUpgradeable(hre, 'VotesERC20', []);
};

export default func;
10 changes: 5 additions & 5 deletions deploy/core/010_deploy_LinearERC20Voting.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const chainId = await hre.getChainId();

// See https://github.com/decentdao/decent-contracts/pull/96
if (chainId === "1" || chainId === "137") {
if (chainId === '1' || chainId === '137') {
return;
}

await deployNonUpgradeable(hre, "LinearERC20Voting", []);
await deployNonUpgradeable(hre, 'LinearERC20Voting', []);
};

export default func;
2 changes: 1 addition & 1 deletion deploy/core/011_deploy_ModuleProxyFactory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { DeployFunction } from 'hardhat-deploy/types';
// import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";

const func: DeployFunction = async (/* hre: HardhatRuntimeEnvironment */) => {
Expand Down
8 changes: 4 additions & 4 deletions deploy/core/012_deploy_KeyValuePairs.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "KeyValuePairs", []);
await deployNonUpgradeable(hre, 'KeyValuePairs', []);
};

export default func;
8 changes: 4 additions & 4 deletions deploy/core/013_deploy_VotesERC20Wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "VotesERC20Wrapper", []);
await deployNonUpgradeable(hre, 'VotesERC20Wrapper', []);
};

export default func;
10 changes: 5 additions & 5 deletions deploy/core/014_deploy_LinearERC20WrappedVoting.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const chainId = await hre.getChainId();

// See https://github.com/decentdao/decent-contracts/pull/96
if (chainId === "1" || chainId === "137") {
if (chainId === '1' || chainId === '137') {
return;
}

await deployNonUpgradeable(hre, "LinearERC20WrappedVoting", []);
await deployNonUpgradeable(hre, 'LinearERC20WrappedVoting', []);
};

export default func;
8 changes: 4 additions & 4 deletions deploy/core/015_deploy_LinearERC721Voting.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "LinearERC721Voting", []);
await deployNonUpgradeable(hre, 'LinearERC721Voting', []);
};

export default func;
8 changes: 4 additions & 4 deletions deploy/core/016_deploy_ERC721FreezeVoting.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "ERC721FreezeVoting", []);
await deployNonUpgradeable(hre, 'ERC721FreezeVoting', []);
};

export default func;
8 changes: 4 additions & 4 deletions deploy/core/017_deploy_DecentHats_0_1_0.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "DecentHats_0_1_0");
await deployNonUpgradeable(hre, 'DecentHats_0_1_0');
};

export default func;
8 changes: 4 additions & 4 deletions deploy/core/018_deploy_DecentSablierStreamManagement.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable";
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { deployNonUpgradeable } from '../helpers/deployNonUpgradeable';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
await deployNonUpgradeable(hre, "DecentSablierStreamManagement");
await deployNonUpgradeable(hre, 'DecentSablierStreamManagement');
};

export default func;
Loading