Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Commit b32153b

Browse files
authored
Add prettier formatter and format solidity code (#544)
* Add prettier formatter and format solidity code * Add format script * Improve format and slither scripts and update README.md * Regenerate bindings * Fix test coverage error and use node container * Add openssh-client to node container * Fix test coverage for licence.sol * Add git to format_check job * Revert build_check changes
1 parent 764c45a commit b32153b

File tree

149 files changed

+587
-485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+587
-485
lines changed

.circleci/config.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
build_check:
2727
machine:
28-
image: ubuntu-1604:201903-01
28+
image: ubuntu-1604:201903-01
2929
working_directory: /home/circleci/github.com/tokencard/contracts
3030
steps:
3131
- checkout
@@ -35,9 +35,19 @@ jobs:
3535
- run: ./build.sh
3636
- run: '[[ -z $(git status -uno --porcelain) ]] || (git status ; echo "Please run ./build.sh before committing changes!"; exit 1)'
3737

38+
format_check:
39+
docker:
40+
- image: node@sha256:d2734cb9a3b16e1103b27bca3f9db410cf6834a11302d1b5304c1d8627fb9732
41+
working_directory: /home/circleci/github.com/tokencard/contracts
42+
steps:
43+
- run: apk add -U git openssh-client ca-certificates
44+
- checkout
45+
- run: npm install --no-package-lock [email protected] [email protected]
46+
- run: npx prettier --list-different --plugin=prettier-plugin-solidity {contracts,contracts/mocks,contracts/internals}/*.sol
47+
3848
mythril:
3949
docker:
40-
- image: mythril/myth:latest
50+
- image: mythril/myth@sha256:75605a2a7e848e416f471a67159d6812feaa45e03ddd352aac588e505d68e5c5
4151
working_directory: /tmp/contracts
4252
parallelism: 6
4353
steps:
@@ -87,7 +97,7 @@ jobs:
8797

8898
slither:
8999
docker:
90-
- image: trailofbits/eth-security-toolbox:latest
100+
- image: trailofbits/eth-security-toolbox@sha256:3fb96e2d9de772f5e97f1c3c650c8a3d28660f8a64a60b76269da1ac19b86a28
91101
working_directory: /tmp/contracts
92102
parallelism: 6
93103
steps:
@@ -139,7 +149,7 @@ jobs:
139149

140150
echidna:
141151
docker:
142-
- image: trailofbits/eth-security-toolbox:latest
152+
- image: trailofbits/eth-security-toolbox@sha256:3fb96e2d9de772f5e97f1c3c650c8a3d28660f8a64a60b76269da1ac19b86a28
143153
working_directory: /tmp/contracts
144154
parallelism: 6
145155
steps:
@@ -198,6 +208,10 @@ workflows:
198208
filters:
199209
tags:
200210
ignore: ""
211+
- format_check:
212+
filters:
213+
tags:
214+
ignore: ""
201215
- mythril:
202216
filters:
203217
tags:

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"overrides": [
3+
{
4+
"files": "*.sol",
5+
"options": {
6+
"printWidth": 160,
7+
"tabWidth": 4,
8+
"useTabs": false,
9+
"singleQuote": false,
10+
"bracketSpacing": false,
11+
"explicitTypes": "always"
12+
}
13+
}
14+
]
15+
}

build/controller/Controller.bin

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/controller/Transferrable.bin

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/controller/combined.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/holder/Balanceable.bin

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/holder/BytesUtils.bin

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/holder/Controller.bin

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/holder/Holder.bin

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/holder/TokenWhitelist.bin

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)