-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: format all files (incl
.nr
) (#5)
* chore: format with dprint * chore: format `nr` files with `rustfmt` * chore: include style check in ci workflow * chore: rename tests workflow to main For consistency with other zk-kit repos * fix: fix yml indentation * fix: fix output name typo in test workflow * fix: add id value to step job * refactor: rename main workflow
- Loading branch information
Showing
27 changed files
with
532 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
const fs = require("node:fs") | ||
const path = require("node:path") | ||
const fs = require('node:fs') | ||
const path = require('node:path') | ||
|
||
const packages = fs.readdirSync(path.resolve(__dirname, "packages")) | ||
const packages = fs.readdirSync(path.resolve(__dirname, 'packages')) | ||
|
||
module.exports = { | ||
extends: ["@commitlint/config-conventional"], | ||
prompt: { | ||
scopes: [...packages], | ||
markBreakingChangeMode: true, | ||
allowCustomIssuePrefix: false, | ||
allowEmptyIssuePrefix: false, | ||
issuePrefixes: [ | ||
{ | ||
value: "re", | ||
name: "re: ISSUES related" | ||
} | ||
] | ||
} | ||
extends: ['@commitlint/config-conventional'], | ||
prompt: { | ||
scopes: [...packages], | ||
markBreakingChangeMode: true, | ||
allowCustomIssuePrefix: false, | ||
allowEmptyIssuePrefix: false, | ||
issuePrefixes: [ | ||
{ | ||
value: 're', | ||
name: 're: ISSUES related', | ||
}, | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"exec": { | ||
"commands": [{ | ||
"command": "rustfmt", | ||
"exts": ["nr"], | ||
}], | ||
}, | ||
"prettier": { | ||
"singleQuote": true, | ||
}, | ||
"typescript": { | ||
"quoteProps": "asNeeded", | ||
"quoteStyle": "preferSingle", | ||
"semiColons": "asi", | ||
"useBraces": "preferNone", | ||
}, | ||
"excludes": [ | ||
"**/node_modules", | ||
"yarn.lock", | ||
".yarn", | ||
"packages/merkle-trees/src/globals.nr", | ||
], | ||
"plugins": [ | ||
"https://plugins.dprint.dev/json-0.19.3.wasm", | ||
"https://plugins.dprint.dev/markdown-0.17.1.wasm", | ||
"https://plugins.dprint.dev/typescript-0.91.1.wasm", | ||
"https://plugins.dprint.dev/exec-0.4.4.json@c207bf9b9a4ee1f0ecb75c594f774924baf62e8e53a2ce9d873816a408cecbf7", | ||
"https://plugins.dprint.dev/toml-0.6.2.wasm", | ||
// keep it last so that it is used only for exts that other plugins don't handle (yaml) | ||
"https://plugins.dprint.dev/prettier-0.40.0.json@68c668863ec834d4be0f6f5ccaab415df75336a992aceb7eeeb14fdf096a9e9c", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: main | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
changed-files: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
any_nr_changed: ${{ steps.changed-files.outputs.any_changed }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: tj-actions/changed-files@v44 | ||
id: changed-files | ||
with: | ||
files: | | ||
packages/**/*.{nr,toml} | ||
Nargo.toml | ||
style: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: yarn | ||
- run: yarn | ||
- run: yarn check | ||
|
||
test: | ||
needs: changed-files | ||
if: needs.changed-files.outputs.any_nr_changed == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: noir-lang/noirup@v0.1.3 | ||
with: | ||
toolchain: 0.26.0 | ||
- run: nargo test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
name: release | ||
|
||
permissions: | ||
contents: write | ||
contents: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: yarn | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Authentication | ||
run: | | ||
echo npmAuthToken: "$NODE_AUTH_TOKEN" >> ./.yarnrc.yml | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Publish packages | ||
run: yarn version:publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- run: yarn version:release | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: yarn | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Authentication | ||
run: | | ||
echo npmAuthToken: "$NODE_AUTH_TOKEN" >> ./.yarnrc.yml | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Publish packages | ||
run: yarn version:publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- run: yarn version:release | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"**/*.{js,json,md,yml,yaml}": "prettier --write" | ||
"**/*.{js,json,md,nr,toml,yml,yaml}": "yarn fmt" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"semi": false, | ||
"arrowParens": "always", | ||
"trailingComma": "none" | ||
"semi": false, | ||
"arrowParens": "always", | ||
"trailingComma": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.