chore: simplify external tools dependency management
This commit is contained in:
parent
582bf63624
commit
c8c2f73a2f
@ -10,5 +10,5 @@ charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{yml,yaml,md}]
|
||||
[*.{yml,yaml,json,md}]
|
||||
indent_size = 2
|
||||
|
34
.github/workflows/ci.yml
vendored
34
.github/workflows/ci.yml
vendored
@ -24,31 +24,14 @@ jobs:
|
||||
components: "clippy, rustfmt"
|
||||
|
||||
- run: "rustc --version"
|
||||
- run: "cargo install cargo-run-bin@1.7.2"
|
||||
|
||||
- run: "cargo build --verbose"
|
||||
- run: "cargo bin mdbook build"
|
||||
- run: "cargo test --verbose"
|
||||
- run: "cargo clippy --verbose -- -D warnings"
|
||||
- run: "cargo fmt -- --check"
|
||||
|
||||
lint-markdown:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v4.1.1"
|
||||
|
||||
- uses: "DavidAnson/markdownlint-cli2-action@v15.0.0"
|
||||
with:
|
||||
config: ".markdownlint-cli2.jsonc"
|
||||
globs: "**/*.md"
|
||||
|
||||
lint-commit:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v4.1.1"
|
||||
|
||||
- uses: "wagoid/commitlint-github-action@v5.4.5"
|
||||
with:
|
||||
configFile: ".commitlintrc.json"
|
||||
failOnWarnings: true
|
||||
|
||||
lint-general:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
@ -57,10 +40,11 @@ jobs:
|
||||
- name: "Setup Node.js"
|
||||
uses: "actions/setup-node@v4.0.1"
|
||||
with:
|
||||
node-version: "20.11.0"
|
||||
node-version: "20.x"
|
||||
|
||||
- run: "npm install --global editorconfig-checker@5.1.2"
|
||||
- run: "npm install --global prettier@3.2.4"
|
||||
- run: "npm clean-install"
|
||||
|
||||
- run: "editorconfig-checker"
|
||||
- run: "prettier . --check"
|
||||
- run: 'npm run lint:commit -- --to "${{ github.sha }}"'
|
||||
- run: "npm run lint:editorconfig"
|
||||
- run: "npm run lint:markdown"
|
||||
- run: "npm run lint:prettier"
|
||||
|
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
target/
|
||||
book/
|
||||
.bin/
|
||||
target
|
||||
node_modules
|
||||
book
|
||||
.bin
|
||||
|
@ -1,33 +1,12 @@
|
||||
{
|
||||
"config": {
|
||||
"extends": "markdownlint/style/prettier",
|
||||
"default": true,
|
||||
"no-inline-html": false,
|
||||
"relative-links": true,
|
||||
"no-duplicate-heading": false,
|
||||
|
||||
/* Disables rules that may conflict with Prettier */
|
||||
/* Reference: https://github.com/DavidAnson/markdownlint/blob/main/style/prettier.json */
|
||||
"blanks-around-fences": false,
|
||||
"blanks-around-headings": false,
|
||||
"blanks-around-lists": false,
|
||||
"code-fence-style": false,
|
||||
"emphasis-style": false,
|
||||
"heading-start-left": false,
|
||||
"hr-style": false,
|
||||
"line-length": false,
|
||||
"list-indent": false,
|
||||
"list-marker-space": false,
|
||||
"no-blanks-blockquote": false,
|
||||
"no-hard-tabs": false,
|
||||
"no-missing-space-atx": false,
|
||||
"no-missing-space-closed-atx": false,
|
||||
"no-multiple-blanks": false,
|
||||
"no-multiple-space-atx": false,
|
||||
"no-multiple-space-blockquote": false,
|
||||
"no-multiple-space-closed-atx": false,
|
||||
"no-trailing-spaces": false,
|
||||
"ol-prefix": false,
|
||||
"strong-style": false,
|
||||
"ul-indent": false,
|
||||
"no-inline-html": false,
|
||||
},
|
||||
"globs": ["**/*.md"],
|
||||
"ignores": ["**/node_modules", "**/target", "**/book", "**/.bin"],
|
||||
"customRules": ["markdownlint-rule-relative-links"],
|
||||
}
|
||||
|
19
README.md
19
README.md
@ -49,14 +49,13 @@ cargo install cargo-run-bin@1.7.2
|
||||
|
||||
#### External Linting Tools (optional)
|
||||
|
||||
**External linting tools** are used to ensure a consistent code style and commit message format. They are **used in the Continuous Integration (CI)** pipeline and **can be optionally used locally**.
|
||||
**External linting tools** are used to ensure a consistent code style (external to Rust) and commit message format. They are **used in the Continuous Integration (CI)** pipeline and **can be optionally used locally**.
|
||||
|
||||
They have to be installed using [Node.js](https://nodejs.org/) >= v20.0.0 and [npm](https://www.npmjs.com/) >= v10.0.0.
|
||||
|
||||
- [editorconfig-checker](https://editorconfig-checker.github.io/) (`npm install --global editorconfig-checker@5.1.2`)
|
||||
- [Prettier](https://prettier.io/) v3.2.4 (`npm install --global prettier@3.2.4`)
|
||||
- [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) v0.12.1 (`npm install --global markdownlint-cli2@0.12.1`)
|
||||
- [commitlint](https://commitlint.js.org/#/) v18.6.0 (`npm install --global @commitlint/cli@18.6.0 @commitlint/config-conventional@18.6.0`)
|
||||
```sh
|
||||
npm clean-install
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
@ -67,17 +66,17 @@ cargo run -- --help
|
||||
# Documentation
|
||||
cargo bin mdbook serve
|
||||
|
||||
# Build, Lint, and Test
|
||||
# Build, Lint, and Test Usage
|
||||
cargo build
|
||||
cargo test
|
||||
cargo clippy --verbose -- -D warnings
|
||||
cargo fmt -- --check
|
||||
|
||||
# External Linting Tools Usage (optional)
|
||||
editorconfig-checker
|
||||
prettier . --check
|
||||
markdownlint-cli2
|
||||
echo 'chore: try commitlint' | commitlint
|
||||
echo 'chore: try commitlint' | npm run lint:commit
|
||||
npm run lint:editorconfig
|
||||
npm run lint:markdown
|
||||
npm run lint:prettier
|
||||
```
|
||||
|
||||
## 💡 Contributing
|
||||
|
2570
package-lock.json
generated
Normal file
2570
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
24
package.json
Normal file
24
package.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "fileformats",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": ">=20.0.0",
|
||||
"npm": ">=10.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint:commit": "commitlint",
|
||||
"lint:editorconfig": "editorconfig-checker",
|
||||
"lint:markdown": "markdownlint-cli2",
|
||||
"lint:prettier": "prettier . --check"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "18.6.0",
|
||||
"@commitlint/config-conventional": "18.6.0",
|
||||
"editorconfig-checker": "5.1.3",
|
||||
"markdownlint": "0.33.0",
|
||||
"markdownlint-cli2": "0.12.1",
|
||||
"markdownlint-rule-relative-links": "2.3.1",
|
||||
"prettier": "3.2.5"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user