Skip to content

Commit 4eec6df

Browse files
committed
fix: prettier fixes
1 parent bcb66bf commit 4eec6df

File tree

78 files changed

+430
-475
lines changed

Some content is hidden

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

78 files changed

+430
-475
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -30,38 +30,19 @@ jobs:
3030
- name: Install dependencies
3131
run: yarn
3232

33-
- name: Get changed files
34-
id: changed-files
35-
uses: tj-actions/changed-files@v44
36-
with:
37-
files_yaml: |
38-
contracts:
39-
- packages/contracts/**/*.{js,json,ts,sol}
40-
packages:
41-
- packages/**/*.{js,json,ts}
42-
- '!packages/{contracts}/**/*'
43-
to_format:
44-
- '**/*.{cjs,js,json,jsx,md,mdx,sol,ts,tsx,yaml,yml}'
45-
to_lint:
46-
- '**/*.{cjs,js,jsx,ts,tsx}'
47-
48-
- if: steps.changed-files.outputs.contracts_any_changed == 'true'
49-
name: Compile and lint contracts
33+
- name: Compile and lint contracts
5034
run: |
5135
yarn compile:contracts
5236
yarn workspace @excubiae/contracts lint
5337
54-
- if: steps.changed-files.outputs.packages_any_changed == 'true'
55-
name: Build packages
38+
- name: Build packages
5639
run: yarn build:packages
5740

58-
- if: steps.changed-files.outputs.to_format_any_changed == 'true'
59-
name: Format
60-
run: yarn run prettier --check --ignore-unknown --no-error-on-unmatched-pattern ${{ steps.changed-files.outputs.to_format_all_changed_files }}
41+
- name: Format
42+
run: yarn format:write
6143

62-
- if: steps.changed-files.outputs.to_lint_any_changed == 'true'
63-
name: Run Eslint
64-
run: yarn run eslint ${{ steps.changed-files.outputs.to_lint_all_changed_files }} --ext .cjs,.js,.jsx,.ts,.tsx
44+
- name: Run Eslint
45+
run: yarn lint:fix
6546

6647
test:
6748
runs-on: ubuntu-latest
@@ -82,16 +63,7 @@ jobs:
8263
- name: Install dependencies
8364
run: yarn
8465

85-
- name: Get changed files
86-
id: changed-files
87-
uses: tj-actions/changed-files@v44
88-
with:
89-
files_yaml: |
90-
contracts:
91-
- packages/contracts/**/*.{js,json,ts,sol}
92-
93-
- if: steps.changed-files.outputs.contracts_any_changed == 'true'
94-
name: Build and Test contracts
66+
- name: Build and Test contracts
9567
run: |
9668
yarn compile:contracts
9769
yarn test:contracts

.lintstagedrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"**/*.{js,ts,jsx,tsx,md,json,sol,yaml,yml}": "prettier --write --no-error-on-unmatched-pattern",
2+
"**/*.{js,ts,jsx,tsx,md,json,yaml,yml}": "prettier --write --no-error-on-unmatched-pattern",
3+
"**/*.{sol}": "yarn workspace @excubiae/contracts format:forge",
34
"**/*.{js,ts,jsx,tsx}": "eslint"
45
}

packages/contracts/contracts/checker/AdvancedChecker.sol

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.20;
33

4-
import {IAdvancedChecker, Check, CheckStatus} from "../interfaces/IAdvancedChecker.sol";
5-
import {Clone} from "../proxy/Clone.sol";
4+
import { IAdvancedChecker, Check, CheckStatus } from "../interfaces/IAdvancedChecker.sol";
5+
import { Clone } from "../proxy/Clone.sol";
66

77
/// @title AdvancedChecker
88
/// @notice Abstract contract for multi-phase validation (PRE, MAIN, POST).
@@ -19,7 +19,12 @@ abstract contract AdvancedChecker is Clone, IAdvancedChecker {
1919
address subject,
2020
bytes calldata evidence,
2121
Check checkType
22-
) external view override returns (bool checked) {
22+
)
23+
external
24+
view
25+
override
26+
returns (bool checked)
27+
{
2328
return _check(subject, evidence, checkType);
2429
}
2530

@@ -46,19 +51,19 @@ abstract contract AdvancedChecker is Clone, IAdvancedChecker {
4651
/// @param subject The address to validate.
4752
/// @param evidence Custom validation data.
4853
/// @return checked Boolean indicating whether the validation passed.
49-
function _checkPre(address subject, bytes calldata evidence) internal view virtual returns (bool checked) {}
54+
function _checkPre(address subject, bytes calldata evidence) internal view virtual returns (bool checked) { }
5055

5156
/// @notice Main validation logic.
5257
/// @dev Derived contracts should override this to implement main check validation.
5358
/// @param subject The address to validate.
5459
/// @param evidence Custom validation data.
5560
/// @return checked Boolean indicating whether the validation passed.
56-
function _checkMain(address subject, bytes calldata evidence) internal view virtual returns (bool checked) {}
61+
function _checkMain(address subject, bytes calldata evidence) internal view virtual returns (bool checked) { }
5762

5863
/// @notice Post-condition validation logic.
5964
/// @dev Derived contracts should override this to implement post-check validation.
6065
/// @param subject The address to validate.
6166
/// @param evidence Custom validation data.
6267
/// @return checked Boolean indicating whether the validation passed.
63-
function _checkPost(address subject, bytes calldata evidence) internal view virtual returns (bool checked) {}
68+
function _checkPost(address subject, bytes calldata evidence) internal view virtual returns (bool checked) { }
6469
}

packages/contracts/contracts/checker/BaseChecker.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.20;
33

4-
import {IBaseChecker} from "../interfaces/IBaseChecker.sol";
5-
import {Clone} from "../proxy/Clone.sol";
4+
import { IBaseChecker } from "../interfaces/IBaseChecker.sol";
5+
import { Clone } from "../proxy/Clone.sol";
66

77
/// @title BaseChecker
88
/// @notice Abstract base contract for implementing validation checks.
@@ -24,5 +24,5 @@ abstract contract BaseChecker is Clone, IBaseChecker {
2424
/// @param subject The address to validate.
2525
/// @param evidence Custom validation data.
2626
/// @return checked Boolean indicating whether the validation passed.
27-
function _check(address subject, bytes calldata evidence) internal view virtual returns (bool checked) {}
27+
function _check(address subject, bytes calldata evidence) internal view virtual returns (bool checked) { }
2828
}

packages/contracts/contracts/extensions/anonAadhaar/AnonAadhaarChecker.sol

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.20;
33

4-
import {BaseChecker} from "../../checker/BaseChecker.sol";
5-
import {IAnonAadhaar} from "./IAnonAadhaar.sol";
4+
import { BaseChecker } from "../../checker/BaseChecker.sol";
5+
import { IAnonAadhaar } from "./IAnonAadhaar.sol";
66

77
/// @title AnonAadhaarChecker
88
/// @notice AnonAadhaar validator.
@@ -58,16 +58,9 @@ contract AnonAadhaarChecker is BaseChecker {
5858
}
5959

6060
// check if the proof validates
61-
if (
62-
!anonAadhaarContract.verifyAnonAadhaarProof(
63-
providedNullifierSeed,
64-
nullifier,
65-
timestamp,
66-
signal,
67-
revealArray,
68-
groth16Proof
69-
)
70-
) {
61+
if (!anonAadhaarContract.verifyAnonAadhaarProof(
62+
providedNullifierSeed, nullifier, timestamp, signal, revealArray, groth16Proof
63+
)) {
7164
revert InvalidProof();
7265
}
7366

packages/contracts/contracts/extensions/anonAadhaar/AnonAadhaarCheckerFactory.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.20;
33

4-
import {Factory} from "../../proxy/Factory.sol";
5-
import {AnonAadhaarChecker} from "./AnonAadhaarChecker.sol";
4+
import { Factory } from "../../proxy/Factory.sol";
5+
import { AnonAadhaarChecker } from "./AnonAadhaarChecker.sol";
66

77
/// @title AnonAadhaarCheckerFactory
88
/// @notice Factory contract for deploying minimal proxy instances of AnonAadhaarChecker.
99
/// @dev Simplifies deployment of AnonAadhaarChecker clones with appended configuration data.
1010
contract AnonAadhaarCheckerFactory is Factory {
1111
/// @notice Initializes the factory with the AnonAadhaarChecker implementation.
12-
constructor() Factory(address(new AnonAadhaarChecker())) {}
12+
constructor() Factory(address(new AnonAadhaarChecker())) { }
1313

1414
/// @notice Deploys a new AnonAadhaarChecker clone.
1515
/// @param anonAadhaarVerifier The address of the anonAadhaar contract

packages/contracts/contracts/extensions/anonAadhaar/AnonAadhaarPolicy.sol

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.20;
33

4-
import {BasePolicy} from "../../policy/BasePolicy.sol";
4+
import { BasePolicy } from "../../policy/BasePolicy.sol";
55

66
/// @title AnonAadhaarPolicy
77
/// @notice Policy contract enforcing Aadhaar validation.
@@ -14,7 +14,7 @@ contract AnonAadhaarPolicy is BasePolicy {
1414

1515
/// @notice Create a new instance of AnonAadhaarPolicy
1616
// solhint-disable-next-line no-empty-blocks
17-
constructor() payable {}
17+
constructor() payable { }
1818

1919
/// @notice Enforce a user if they can prove anonAadhaar proof
2020
/// @dev Throw if the proof is not valid or just complete silently
@@ -23,10 +23,7 @@ contract AnonAadhaarPolicy is BasePolicy {
2323
/// and groth16Proof.
2424
function _enforce(address subject, bytes calldata evidence) internal override {
2525
// decode the argument
26-
(, uint256 nullifier, , , , ) = abi.decode(
27-
evidence,
28-
(uint256, uint256, uint256, uint256, uint256[4], uint256[8])
29-
);
26+
(, uint256 nullifier,,,,) = abi.decode(evidence, (uint256, uint256, uint256, uint256, uint256[4], uint256[8]));
3027

3128
if (enforcedAadhaars[nullifier]) {
3229
revert AlreadyEnforced();

packages/contracts/contracts/extensions/anonAadhaar/AnonAadhaarPolicyFactory.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.20;
33

4-
import {Factory} from "../../proxy/Factory.sol";
5-
import {IPolicyFactory} from "../../interfaces/IPolicyFactory.sol";
6-
import {AnonAadhaarPolicy} from "./AnonAadhaarPolicy.sol";
4+
import { Factory } from "../../proxy/Factory.sol";
5+
import { IPolicyFactory } from "../../interfaces/IPolicyFactory.sol";
6+
import { AnonAadhaarPolicy } from "./AnonAadhaarPolicy.sol";
77

88
/// @title AnonAadhaarPolicyFactory
99
/// @notice Factory contract for deploying minimal proxy instances of AnonAadhaarPolicy.
1010
/// @dev Simplifies deployment of AnonAadhaarPolicy clones with appended configuration data.
1111
contract AnonAadhaarPolicyFactory is Factory, IPolicyFactory {
1212
/// @notice Initializes the factory with the AnonAadhaarPolicy implementation.
13-
constructor() Factory(address(new AnonAadhaarPolicy())) {}
13+
constructor() Factory(address(new AnonAadhaarPolicy())) { }
1414

1515
/// @notice Deploys a new AnonAadhaarPolicy clone with the specified checker address.
1616
/// @dev Encodes the checker address and caller as configuration data for the clone.

packages/contracts/contracts/extensions/anonAadhaar/IAnonAadhaar.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ interface IAnonAadhaar {
99
uint256 signal,
1010
uint256[4] memory revealArray,
1111
uint256[8] memory groth16Proof
12-
) external view returns (bool);
12+
)
13+
external
14+
view
15+
returns (bool);
1316
}

packages/contracts/contracts/extensions/eas/EASChecker.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.20;
33

4-
import {BaseChecker} from "../../checker/BaseChecker.sol";
5-
import {IEAS} from "./IEAS.sol";
4+
import { BaseChecker } from "../../checker/BaseChecker.sol";
5+
import { IEAS } from "./IEAS.sol";
66

77
/// @title EASChecker
88
/// @notice EAS validator.

0 commit comments

Comments
 (0)