diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 27a4eb10..260a531e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,13 +50,6 @@ jobs: - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v2 - with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ matrix.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ matrix.os }}-yarn- - run: yarn --frozen-lockfile - - run: yarn lint \ No newline at end of file + - run: yarn lint + - run: yarn fmt:check \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..def68ef3 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,16 @@ +{ + "plugins": ["prettier-plugin-solidity"], + "overrides": [ + { + "files": "*.sol", + "options": { + "parser": "solidity-parse", + "printWidth": 80, + "tabWidth": 4, + "useTabs": false, + "singleQuote": false, + "bracketSpacing": false + } + } + ] + } \ No newline at end of file diff --git a/package.json b/package.json index e46a6c2a..80dcc6f6 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "license": "MIT", "scripts": { "fmt": "prettier 'contracts/**/*.sol' -w && prettier 'test/**/*.sol' -w", + "fmt:check": "prettier 'contracts/**/*.sol' -c && prettier 'test/**/*.sol' -c", "lint": "solhint 'contracts/**/*.sol' 'test/**/*.sol'" }, "dependencies": {