Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 14 additions & 18 deletions .github/workflows/solidity-foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ jobs:
run: |
cat <<EOF > matrix.json
[
{ "name": "automation", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": false, "run-forge-fmt": false }},
{ "name": "functions", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "keystone", "setup": { "run-coverage": true, "min-coverage": 72.8, "run-gas-snapshot": false, "run-forge-fmt": false }},
{ "name": "l2ep", "setup": { "run-coverage": true, "min-coverage": 65.0, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "llo-feeds", "setup": { "run-coverage": true, "min-coverage": 49.3, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "operatorforwarder", "setup": { "run-coverage": true, "min-coverage": 55.7, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "shared", "setup": { "run-coverage": true, "extra-coverage-params": "--no-match-path='*CallWithExactGas*' --ir-minimum", "min-coverage": 29, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "vrf", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": false, "run-forge-fmt": false }},
{ "name": "workflow", "setup": { "run-coverage": true, "extra-coverage-params": "--ir-minimum --no-match-coverage='(.*v1/test.*)|(.*v2/test.*)'", "min-coverage": 93.0, "run-gas-snapshot": true, "run-forge-fmt": true }},
{ "name": "data-feeds", "setup": { "run-coverage": true, "min-coverage": 98.5, "run-gas-snapshot": true, "extra-coverage-params": "--no-match-coverage='WIP*'", "run-forge-fmt": false }}
{ "name": "automation", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": false }},
{ "name": "functions", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": true }},
{ "name": "keystone", "setup": { "run-coverage": true, "min-coverage": 72.8, "run-gas-snapshot": false }},
{ "name": "l2ep", "setup": { "run-coverage": true, "min-coverage": 65.0, "run-gas-snapshot": true }},
{ "name": "llo-feeds", "setup": { "run-coverage": true, "min-coverage": 49.3, "run-gas-snapshot": true }},
{ "name": "operatorforwarder", "setup": { "run-coverage": true, "min-coverage": 55.7, "run-gas-snapshot": true }},
{ "name": "shared", "setup": { "run-coverage": true, "extra-coverage-params": "--no-match-path='*CallWithExactGas*' --ir-minimum", "min-coverage": 29, "run-gas-snapshot": true }},
{ "name": "vrf", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": false }},
{ "name": "workflow", "setup": { "run-coverage": true, "extra-coverage-params": "--ir-minimum --no-match-coverage='(.*v1/test.*)|(.*v2/test.*)'", "min-coverage": 93.0, "run-gas-snapshot": true }},
{ "name": "data-feeds", "setup": { "run-coverage": true, "min-coverage": 98.5, "run-gas-snapshot": true, "extra-coverage-params": "--no-match-coverage='WIP*'" }}

]
EOF
Expand Down Expand Up @@ -75,7 +75,6 @@ jobs:
non_src:
- '.github/workflows/solidity-foundry.yml'
- 'contracts/foundry.toml'
- 'contracts/gas-snapshots/*.gas-snapshot'
- 'contracts/package.json'
- 'contracts/GNUmakefile'
sol:
Expand All @@ -100,9 +99,6 @@ jobs:
- 'contracts/src/v0.8/vrf/**/*.sol'
shared:
- 'contracts/src/v0.8/shared/**/*.sol'
- 'contracts/src/v0.8/*.sol'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too wide, this would mean every single Solidity change triggers the shared CI.

- 'contracts/src/v0.8/mocks/**/*.sol'
- 'contracts/src/v0.8/tests/**/*.sol'
- 'contracts/src/v0.8/vendor/**/*.sol'
workflow:
- 'contracts/src/v0.8/workflow/**/*.sol'
Expand Down Expand Up @@ -596,22 +592,22 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout the repo
if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true') && matrix.product.setup.run-forge-fmt }}
if: ${{ contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true' }}
uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive

- name: Setup NodeJS
if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true') && matrix.product.setup.run-forge-fmt }}
if: ${{ contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true' }}
uses: ./.github/actions/setup-nodejs

- name: Install Foundry
if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true') && matrix.product.setup.run-forge-fmt }}
if: ${{ contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true' }}
uses: ./.github/actions/install-solidity-foundry

- name: Run Forge fmt
if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true') && matrix.product.setup.run-forge-fmt }}
if: ${{ contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true' }}
run: forge fmt --check
id: fmt
working-directory: contracts
Expand Down
87 changes: 0 additions & 87 deletions .github/workflows/solidity-wrappers.yml

This file was deleted.

21 changes: 2 additions & 19 deletions .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,28 +148,11 @@ jobs:
- name: Run solhint on tests
run: pnpm solhint-test

prettier:
defaults:
run:
working-directory: contracts
needs: [changes]
if: needs.changes.outputs.changes == 'true'
name: Prettier Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup NodeJS
uses: ./.github/actions/setup-nodejs
- name: Run prettier check
run: pnpm prettier:check

publish-beta:
name: Publish Beta NPM
environment: publish-contracts
needs: [tag-check, changes, lint, prettier, native-compile]
needs: [tag-check, changes, lint, native-compile]
if: needs.tag-check.outputs.is-pre-release-core == 'true'
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -216,7 +199,7 @@ jobs:
publish-prod:
name: Publish Prod NPM
environment: publish-contracts
needs: [tag-check, changes, lint, prettier, native-compile]
needs: [tag-check, changes, lint, native-compile]
if: needs.tag-check.outputs.is-release-core == 'true'
runs-on: ubuntu-latest
permissions:
Expand Down
8 changes: 1 addition & 7 deletions contracts/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
**/node_modules/**
**/generated/**
core/
**/dist/**
**/artifacts/**
**/public/**
**/build/**
truffle-config.js
truffle.js
gethload.js

pnpm-lock.yaml
coverage
Expand All @@ -20,9 +16,7 @@ node_modules
solc
LinkToken.json
typechain
**/vendor
src/v0.8/workflow/**
src/v0.8/data-feeds/**
src

# Ignore TS definition and map files
**/**.d.ts
Expand Down
16 changes: 1 addition & 15 deletions contracts/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,5 @@
"printWidth": 80,
"endOfLine": "auto",
"tabWidth": 2,
"trailingComma": "all",
"plugins": ["prettier-plugin-solidity"],
"overrides": [
{
"files": "*.sol",
"options": {
"parser": "solidity-parse",
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
}
]
"trailingComma": "all"
}
15 changes: 0 additions & 15 deletions contracts/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,4 @@ module.exports = {
endOfLine: 'auto',
tabWidth: 2,
trailingComma: 'all',
plugins: ['prettier-plugin-solidity'],
overrides: [
{
files: '*.sol',
options: {
parser: 'solidity-parse',
printWidth: 120,
tabWidth: 2,
useTabs: false,
singleQuote: false,
bracketSpacing: false,
explicitTypes: 'always',
},
},
],
}
8 changes: 1 addition & 7 deletions contracts/.solhint-test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "solhint:recommended",
"plugins": ["prettier", "chainlink-solidity"],
"plugins": ["chainlink-solidity"],
"rules": {
"compiler-version": ["off", "^0.8.0"],
"const-name-snakecase": "off",
Expand All @@ -25,12 +25,6 @@
}
],
"not-rely-on-time": "off",
"prettier/prettier": [
"off",
{
"endOfLine": "auto"
}
],
"no-empty-blocks": "off",
"quotes": ["error", "double"],
"reason-string": [
Expand Down
8 changes: 1 addition & 7 deletions contracts/.solhint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "solhint:recommended",
"plugins": ["prettier", "chainlink-solidity"],
"plugins": [ "chainlink-solidity"],
"rules": {
"compiler-version": ["off", "^0.8.0"],
"const-name-snakecase": "off",
Expand All @@ -21,12 +21,6 @@
}
],
"not-rely-on-time": "off",
"prettier/prettier": [
"off",
{
"endOfLine": "auto"
}
],
"no-empty-blocks": "off",
"quotes": ["error", "double"],
"reason-string": [
Expand Down
2 changes: 1 addition & 1 deletion contracts/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodejs 20.13.1
nodejs 22.18.0
pnpm 10.6.5
2 changes: 1 addition & 1 deletion contracts/STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ When making (small) changes in existing files,
it is not required to adhere to this guide if it conflicts with other practices in that existing file.
Consistency is preferred.

We use `forge fmt` for all new projects, but some older ones still rely on `prettier`.
We use `forge fmt` for all projects.


# <a name="guidelines"></a>Guidelines
Expand Down
7 changes: 0 additions & 7 deletions contracts/eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,12 @@ module.exports = defineConfig([
globalIgnores([
'**/node_modules/**/*',
'**/generated/**/*',
'**/core/',
'**/dist/**/*',
'**/artifacts/**/*',
'**/public/**/*',
'**/build/**/*',
'**/fixtures/**/*',
'**/lib/**/*',
'**/truffle-config.js',
'**/truffle.js',
'**/gethload.js',
'**/craco.config.js',
'integration/apocalypse/**/*',
'**/contracts/',
'tools/ci-ts/tests/ethers/**/*',
]),
])
3 changes: 3 additions & 0 deletions contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ tab_width = 2
multiline_func_header = "params_first"
sort_imports = true
single_line_statement_blocks = "preserve"
ignore = ["src/v0.8/vendor/**/*.sol"]
number_underscore = "thousands"
wrap_comments = true

[profile.functions]
optimizer_runs = 1_000_000
Expand Down
Loading
Loading