Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
entorb committed Apr 30, 2024
1 parent 2dc8d01 commit 77dda3f
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ see <https://docs.astral.sh/ruff/>
* configures the Ruff linter and formatter hook
* Ruff includes the features of these linters: flake8, pyupgrade and autoflake
* Ruff includes the features of these formatters: black, isort, add-trailing-comma
* Ruff offers a list of 700+ rules, see <https://docs.astral.sh/ruff/rules/> for list
* Ruff offers a list of 700+ rules, see [docs.astral.sh/ruff/rules/](https://docs.astral.sh/ruff/rules/) for list
* in my configuration I enabled most of them

To disable ruff checking of a (legacy) file or path, you can

* add a `# ruff: noqa` comment inside that file
* exclude via [.ruff.toml](.ruff.toml): `extend-exclude = ["src/MyFile1.py"]`
* exclude via [.ruff.toml](.ruff.toml) -> `extend-exclude = ["src/MyFile1.py"]`
* exclude via [.pre-commit-config.yaml](.pre-commit-config.yaml)
* exclude via .gitignore file
* exclude via [.gitignore](.gitignore)

To disable a certain rule for a file add

Expand All @@ -45,11 +45,33 @@ To disable a certain rule for a specific line of code:

## configure cspell hook (spell checker)

see <https://cspell.org>
see <https://cspell.org> and [cspell.org/configuration/document-settings/](https://cspell.org/configuration/document-settings/)

* [cspell.json](cspell.json) config
* [cspell-words.txt](cspell-words.txt) custom dictionary

To disable cspell checking of a file or path, you can use

* add a `# cspell: disable` comment inside that file
* exclude via [cspell.config.yaml](cspell.config.yaml) -> ignorePaths
* exclude via [.gitignore](.gitignore)

To disable the spellchecking for a section of the file

* `# cspell: disable`
* `...`
* `# cspell: enable`

To disable a certain word for a file

* `# cspell:ignore myword myyword` add to file-specifiv ignore list
* `# cspell:words myword myyword` add to file-specifiv dictionary
* `# cspell:disable-next-line`
* `# cspell:ignoreRegExp g{5}|h{5}`

Aliases:
`cspell:` `cSpell:` `spell-checker:` `spellchecker:`

## run pre-commit manually

`pre-commit run --all-files`
Expand All @@ -58,18 +80,21 @@ or

`pre-commit run --files myFile1.py myFile2.json`

## run pre-commit automated upon each `git commit` command
## run pre-commit automatically triggered upon each `git commit` command

`pre-commit install`

to install the hook so it will be executed upon each local `git commit` command.

## run pre-commit automated via GitHub Actions

Copy dir [.github/workflows/](.github/workflows/) to your repo, to automatically trigger the run upon push of commits and creation of pull requests.

## update pre-commit hooks to latest version

`pre-commit autoupdate`

to update versions of all hooks in [.pre-commit-config.yaml](.pre-commit-config.yaml) to the latest version.

## run pre-commit automated via GitHub Actions

Copy dir [.github/workflows/](.github/workflows/) to your repo, to

* automatically trigger the run upon push of commits and creation of pull requests
* weekly autoupdate hook versions in [.pre-commit-config.yaml](.pre-commit-config.yaml)

0 comments on commit 77dda3f

Please sign in to comment.