Closed mindlessroman closed 8 months ago
For some reason I am getting an InvalidManifestError
for the following pre-commit-config.yaml
file. Any hints as to what's wrong (is there a pre-commit-config.yaml
validator anywhere?)
repos:
- repo: https://github.com/tbroadley/spellchecker-cli
rev: v6.1.1
hooks:
- id: spellchecker-cli
name: spellchecker
description: A pre-commit implementation for spellchecker-cli
entry: spellchecker
language: node
types: [markdown]
Looking at this part of the pre-commit documentation: https://pre-commit.com/#pre-commit-configyaml---hooks
I don't think the hooks
object in a .pre-commit-config.yaml
can have description
, entry
, or language
properties.
We should adjust the example in this project's README.
I'm successfully using:
- repo: https://github.com/markdownlint/markdownlint
rev: v0.12.0
hooks:
- id: markdownlint
name: Markdownlint
description: Run markdownlint on your Markdown files
entry: mdl
language: ruby
files: \.(md|mdown|markdown)$
Are those fields perhaps defined as part of a particular pre-commit action? Is pre-commit
forgiving?
I can't find any combination of keys (yet!), or even a minimal combination (yet!) that will run for me with spellchecker-cli
.
FWIW, I am using pre-commit
version: 3.4.0
@psychemedia - I've successfully used it referencing the commit hash. Since the release you picked doesn't have a pre-commit-config.yaml
, I don't think it can successfully run.
- repo: https://github.com/tbroadley/spellchecker-cli
rev: e4879b5 # TODO: Release tag
hooks:
- id: spellchecker-cli
name: spellcheck
types: [markdown]
stages:
- "pre-commit"
@tbroadley I think at the least, in the mean time having the README.md
point to the commit hash until there's a release will probably help with this. I can make a PR for this?
@mindlessroman ah - that seems to do the trick... thanks...
Is there a way of specifying dictionaries in the hook config?
If I try to pass args from my local .pre-commit-config,yaml
file, such as the following (or variants thereof):
args: ['--no-suggestions', '--dictionaries', 'dictionary.txt']
I get an error:
spellchecker.............................................................Failed
- hook id: spellchecker-cli
- exit code: 1
A list of files is required.
Could this be something to do with pass_filenames
attribute (default: true
) in the hook declaration in the repo?
Hey, I'm sorry I haven't responded in a couple of weeks. To be honest, I don't expect I'll have time in the next six weeks to work on fixing the bugs that folks have pointed out in this issue. I would definitely accept PRs to fix them! I just don't think I can fix them myself. Thanks again for pointing these things out.
I can try to take a stab at this shortly since I introduced it XD
Is there a way of specifying dictionaries in the hook config?
@psychemedia You can specify the dictionaries in the spellcheckerrc.[*]
file (my team's is in a yaml
file):
files:
- "**/*.md"
- "!SUPPORT.md"
- "!CODE_OF_CONDUCT.md"
- "!SECURITY.md"
dictionaries:
- dictionary.txt
The precommit should pick up these settings? But I can take a peek about making it so it can be handled in the pre-commit hook as well
@tbroadley - did the pre-commit make it into the new release?
No, I never cut a new NPM release after #115 merged. I figured that it wasn't necessary because pre-commit would install the repo from GitHub, not NPM. But I can cut a new minor release just in case.
Just published 6.2.0.
Just published 6.2.0.
Awesome! I believe it would need to have the version tag that included the .pre-commit-hooks.yaml
file.
Should be good to go now!
I realized that the README will probably need an update about which
rev
to use.In the mean time, my team will use the commit hash, but just for awareness, @tbroadley.