John Bampton
f515669ce3
Add codespell config file .codespellrc
...
Add `.codespellrc` to the GitHub labeler
Can now run codespell from the command line standalone and it will use
our standard config file. Running codespell with pre-commit will also use this config.
Useful when regenerating the ignored words file on the command line.
https://github.com/codespell-project/codespell?tab=readme-ov-file#using-a-config-file
https://github.com/codespell-project/codespell?tab=readme-ov-file#pre-commit-hook
2025-05-09 20:54:27 +10:00
John Bampton
ddae958405
pre-commit: autoupdate and update node LTS version
...
https://nodejs.org/en
https://pre-commit.com/#pre-commit-autoupdate
2025-05-03 02:00:44 +10:00
Yukihiro "Matz" Matsumoto
9a0f96e617
pre-commit autoupdate
2025-04-16 22:34:27 +09:00
dearblue
40095bf755
Exclude the external project "lrama" from pre-commit
2025-04-08 22:11:32 +09:00
John Bampton
14f2e6db5a
pre-commit: update prettier to the latest version
...
https://www.npmjs.com/package/prettier
2025-03-29 16:31:58 +10:00
John Bampton
14de644234
Update pre-commit Node.js version to v22.14.0 LTS
2025-03-29 07:32:47 +10:00
John Bampton
c1a0a6193b
pre-commit autoupdate
2025-03-28 08:04:21 +10:00
John Bampton
1ae4f94844
Clean up and standardize the pre-commit config
2025-03-28 07:39:59 +10:00
Yukihiro "Matz" Matsumoto
a6848ca2cb
pre-commit autoupdate
2025-03-15 16:34:18 +09:00
Yukihiro "Matz" Matsumoto
1a026ba9aa
pre-commit: autoupdate
2025-03-07 17:17:46 +09:00
Yukihiro "Matz" Matsumoto
91a7bc53a6
.pre-commit-config.yml: pre-commit autoupdate
2025-01-21 13:07:44 +09:00
John Bampton
7fb6fdd4e2
Add more details to the pre-commit config
2024-11-25 22:49:30 +10:00
John Bampton
a7c947360e
[CI] Add prettier to pre-commit
...
Add `.prettierignore` and the `.prettierrc` config file. Prettier is currently targeting the `JSON`, `Markdown` and `YAML` files in the mruby repo.
Additional file types can be targetted with prettier via additional community plugins.
https://prettier.io/docs/en/
You can see all the languages that are supported on the homepage:
https://prettier.io/
This PR references a few other issues and PRs
We did have prettier running with pre-commit before that method was removed from prettier.
https://github.com/mruby/mruby/pull/6292
https://github.com/mruby/mruby/issues/6291
https://github.com/mruby/mruby/issues/6138
https://github.com/mruby/mruby/pull/5490
Perhaps we could add more npm software to pre-commit in future using new the `local` repo approach.
https://pre-commit.com/#repository-local-hooks
The best part is that it runs with pre-commit on our local machines on `git commit` and also when running `pre-commit run --all-files` or for example when running `make check`.
There were also some minor fixes / style changes in the pre-commit config to standardize casing.
https://www.npmjs.com/package/prettier?activeTab=readme
2024-11-20 14:51:11 +10:00
Yukihiro "Matz" Matsumoto
b4ab4cd7cf
Merge branch 'master' into add-pre-commit-hook-gitleaks
2024-10-17 02:33:23 -04:00
Yukihiro "Matz" Matsumoto
389740e1d2
Merge pull request #6377 from jbampton/add-pre-commit-hook-oxipng
2024-10-16 03:34:12 -04:00
John Bampton
42d3eb4b60
Add pre-commit hook gitleaks to detect and prevent hardcoded secrets
...
https://github.com/gitleaks/gitleaks
Adding another check/test to our pre-commit framework.
gitleaks is a popular tool that helps with security.
Removes the gitleaks check from the Super-Linter.
So now we can run gitleaks with pre-commit on `git commit`
2024-10-16 04:20:49 +10:00
John Bampton
e0a9a06c77
Add pre-commit hook pretty-format-json
...
https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#pretty-format-json
From the official pre-commit team a minor feature to add.
We have one JSON file at `.github/linters/mlc_config.json`.
2024-10-16 03:56:19 +10:00
John Bampton
83040c50e7
Add pre-commit hook oxipng for lossless PNG compression
...
Oxipng is a multithreaded lossless PNG/APNG compression optimizer.
Lossless compression is a class of data compression that allows the original data to be perfectly reconstructed from the compressed data with no loss of information.
https://en.wikipedia.org/wiki/Lossless_compression
https://github.com/shssoichiro/oxipng?tab=readme-ov-file#git-integration-via-pre-commit
Oxipng is a multithreaded PNG optimizer written in Rust
https://pre-commit.com/index.html#rust
"pre-commit will bootstrap rust if it is not present."
2024-10-16 03:10:16 +10:00
John Bampton
95f58d8a98
Upgrade pre-commit min version; add hook; pre-commit autoupdate
...
https://github.com/pre-commit/pre-commit-hooks/releases/tag/v5.0.0
pre-commit-hooks now requires pre-commit>=3.2.0
https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#check-illegal-windows-names
https://pre-commit.com/#pre-commit-autoupdate
refs pre-commit/pre-commit#2808
https://pre-commit.com/#top_level-default_stages
2024-10-11 03:32:16 +10:00
Yukihiro "Matz" Matsumoto
12264e33e5
Merge pull request #6361 from jbampton/add-pre-commit-hook-shellcheck
2024-09-24 09:44:25 +09:00
John Bampton
2adf60320d
Add pre-commit hook check-json
...
https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#check-json
Adds another check/test to our pre-commit framework for checking JSON files
We have one JSON file at `.github/linters/mlc_config.json`
2024-09-24 00:47:27 +10:00
John Bampton
6fe57ae44e
Add pre-commit hook shellcheck-py to check syntax of shell scripts
...
https://github.com/shellcheck-py/shellcheck-py
https://www.shellcheck.net/
https://github.com/koalaman/shellcheck
Remove bash/shell checking from the Super-Linter
2024-09-22 10:18:21 +10:00
John Bampton
6d749e92ed
Add pre-commit hook actionlint
...
Validate GitHub Actions with pre-commit.
Remove the Super-Linter GitHub Actions check.
It is more useful to run "actionlint" with pre-commit
since the hooks run on our local machines on git commit.
We also run pre-commit on GitHub.
Whereas the Super-Linter tests only run on GitHub.
https://github.com/rhysd/actionlint/blob/main/docs/usage.md#pre-commit
2024-09-22 08:51:42 +10:00
John Bampton
06becc3495
pre-commit autoupdate
2024-06-21 08:14:17 +10:00
John Bampton
bbb0dddc7e
Remove prettier from pre-commit
2024-06-21 08:14:17 +10:00
John Bampton
fef91724cb
pre-commit autoupdate
...
https://pre-commit.com/#pre-commit-autoupdate
2024-04-21 23:21:46 +10:00
Yukihiro "Matz" Matsumoto
24c60895cd
Merge pull request #6214 from jbampton/add-more-comments
...
Improve the `pre-commit` and `.github` YAML files
2024-03-26 11:12:06 +09:00
John Bampton
cc6d25dc29
Improve the pre-commit and .github YAML files
2024-03-23 22:46:19 +10:00
John Bampton
2e9f79409a
Add pre-commit hook destroyed-symlinks
...
https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#destroyed-symlinks
Another check or test we can have
2024-03-23 20:46:11 +10:00
John Bampton
f18d8888ba
Clean up the pre-commit config
...
Removal of unneeded files / file types
Clean up the repo root folder by moving `codespell.txt`
2024-03-16 20:03:21 +10:00
John Bampton
3b3f8b1196
pre-commit: fix the arguments syntax
...
https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#use-with-pre-commit
https://yamllint.readthedocs.io/en/stable/integration.html#integration-with-pre-commit
2024-03-12 01:55:21 +10:00
John Bampton
fc13411c61
pre-commit autoupdate
...
https://pre-commit.com/#pre-commit-autoupdate
2024-03-02 13:37:00 +10:00
John Bampton
8772592fa2
pre-commit: add markdown-link-check config and ignore links
...
https://github.com/tcort/markdown-link-check?tab=readme-ov-file#config-file-format
2024-02-20 12:28:16 +10:00
John Bampton
f8f3ff10fa
pre-commit: add hook detect-aws-credentials
...
https://github.com/pre-commit/pre-commit-hooks#detect-aws-credentials
Another check or test we can have.
"--allow-missing-credentials - Allow hook to pass when no credentials are detected."
2024-01-11 03:18:15 +10:00
John Bampton
19d0ea803d
Fix pre-commit failure from prettier
2023-12-31 21:57:58 +10:00
Yukihiro "Matz" Matsumoto
ebf66a2b80
Add prettier pre-commit hook; close #5490
2023-12-25 08:02:58 +09:00
Yukihiro "Matz" Matsumoto
28b526cf81
Update .pre-commit-config.yaml
2023-12-21 16:47:16 +09:00
Yukihiro "Matz" Matsumoto
9da0c7e1a4
Update .pre-commit-config.yaml
2023-12-03 09:39:33 +09:00
John Bampton
903ffb1584
pre-commit autoupdate
...
https://pre-commit.com/#pre-commit-autoupdate
2023-10-04 01:17:23 +10:00
John Bampton
6ac6d690dd
pre-commit: add hook forbid-submodules
...
https://github.com/pre-commit/pre-commit-hooks#forbid-submodules
If you want to ban them entirely use forbid-submodules.
Really this is just one extra check or test we can have.
2023-08-13 11:17:22 +10:00
John Bampton
a2785a8180
pre-commit: file-contents-sorter ensure each line is unique
...
https://github.com/pre-commit/pre-commit-hooks#file-contents-sorter
2023-07-30 04:25:38 +10:00
John Bampton
0464ca3870
Run pre-commit autoupdate
2023-07-24 22:26:53 +10:00
John Bampton
f14f2ae174
Standardize the pre-commit config
2023-06-13 08:54:17 +10:00
John Bampton
ac0e157b89
pre-commit: add hook markdown-link-check
...
https://github.com/tcort/markdown-link-check
2023-05-11 12:37:38 +10:00
John Bampton
be722da0d1
pre-commit autoupdate
...
Run `rake checkupdate`
2023-05-03 22:49:34 +10:00
John Bampton
d4dd75b82c
Run rake checkupdate
...
`pre-commit autoupdate`
2023-02-25 08:12:50 +10:00
Yukihiro "Matz" Matsumoto
6de5e00a6c
pre-commit-config.yaml: update
2023-01-07 16:39:46 +09:00
Yukihiro "Matz" Matsumoto
ab0a7f0583
Merge pull request #5839 from jbampton/script-must-not-have-extension
...
pre-commit(shell): add hook `script-must-not-have-extension`
2022-11-01 23:16:04 +09:00
John Bampton
af0b3e3388
pre-commit(shell): add hook script-must-not-have-extension
...
```
mruby % file -I mrbgems/mruby-bin-config/mruby-config
mrbgems/mruby-bin-config/mruby-config: text/x-shellscript; charset=us-ascii
```
The Google shell style guide states:
Executables should have no extension (strongly preferred)
This hook checks for conformance.
https://github.com/jumanjihouse/pre-commit-hooks#script-must-not-have-extension
We are already using hooks from "jumanjihouse" in the `mgem-list` repo.
https://github.com/mruby/mgem-list/blob/f5904922d5fbc87f45c582b8ef759e2ebf16df79/.pre-commit-config.yaml#L39
2022-10-29 23:08:48 +10:00
John Bampton
e7507778a4
pre-commit(tabs): use blacklist to exclude files
...
Add `indent_style = space` to the `.editorconfig` file for batch files.
2022-10-29 20:26:00 +10:00