Extend the pre-commit hook config from the README.md with
additional_dependencies. For example:
# .pre-commit-config.yaml
repos:
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v6.7.0
hooks:
- id: cspell
additional_dependencies:
- "@cspell/dict-fr-fr"
- "@cspell/dict-fr-reforme"
For a complete list of available dictionaries, see: https://github.com/streetsidesoftware/cspell-dicts.
Use a cspell.json such as the following:
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"import": [
"@cspell/dict-fr-fr/cspell-ext.json",
"@cspell/dict-fr-reforme/cspell-ext.json"
],
"language": "fr",
"version": "0.2"
}A file such as mots-française.md containing:
# Testing french in Markdown
## Les mots
Voici, nous avons les mots française.When cspell is invoked mots-française.md should not show errors
And to apply those dictionaries to files with the .md extension (Markdown),
use a cspell.json such as:
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"import": [
"@cspell/dict-fr-fr/cspell-ext.json",
"@cspell/dict-fr-reforme/cspell-ext.json"
],
"overrides": [
{
"filename": "**/*.md",
"language": "fr,fr-fr,fr-90"
}
],
"version": "0.2"
}And the following, as mots-française.md:
# Testing french in Markdown
## Les mots
Voici, nous avons les mots françaiseas again as mots-française.err:
# Testing french in Markdown
## Les mots
Voici, nous avons les mots françaiseWhen cspell is invoked mots-française.md should not show errors, but
mots-française.err should.
Via pre-commit
-
Project folder initialized as a git repository via
git initor as part of a git repository cloned viagit clone -
A
.pre-commit-config.yamlsuch as:fail_fast: true minimum_pre_commit_version: 2.18.1 repos: - repo: "https://github.com/streetsidesoftware/cspell-cli" rev: v6.7.0 hooks: - id: cspell
-
Stage all files
git add --all . -
Check all files in
gitagainstpre-commithookspre-commit run --all-files
-
OR commit the changes
git commit
-
Execute
cspell '**'