-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make this work with pre-commit #49
Comments
I thought this would be easy, but I can't make it work. I added a - id: pylanguagetool
name: Spellcheck with Languagetool
description: Checks the spelling
entry: pylanguagetool
language: python Then I ran the pre-commits with I get the following error
Even if I try to pass a file directly by adjusting
Guess its not so easy :/ |
Okay, that really confused me, but I found the reason: It turns out 2017 me didn't think this code block through: pyLanguagetool/pylanguagetool/cli.py Lines 101 to 126 in b59d3f4
The So with 63ac997 pylanguagetool will now only read from stdin if no input file has been specified. With this, the rest should be possible now. Please report back if there are issues and if not, I can release a new version. BTW, in case you are planning to use languagetool in an automated way, I would strongly recommend pointing it to your own languagetool server and not hitting the main https://languagetool.org/ one with requests. |
I made it work by cloning the latest version of the repo and adding the following - id: pylanguagetool
name: Spellcheck with Languagetool
description: Checks the spelling
entry: pylanguagetool
additional_dependencies:
- markdown2
- beautifulsoup4
language: python
then I ran it with
That worked. What didn't work was if I add this to my - repo: local
hooks:
- id: pylanguagetool
files: '.*\.(md|markdown)'
name: Languagetool spellcheck
entry: pylanguagetool --input-type md -v
language: python
additional_dependencies: [pylanguagetool, beautifulsoup4, markdown2] But I guess this doesn't work because this doesn't take the latest commit, but the latest release instead? |
The pre-commit works with my fork https://github.com/Roald87/pyLanguagetool I added the following to my - repo: https://github.com/Roald87/pyLanguagetool
rev: 2cd8080
hooks:
- id: pylanguagetool
files: '.*\.(md|markdown)'
name: Languagetool spellcheck
entry: pylanguagetool --input-type markdown It works for a single file, but not if I try to run it on multiple files. I then get the error |
My fork now also works for multiple files |
Note that this pre-commit doesn't work with pre-commit.ci, because it doesn't allow network access. When you run it you get the error: pre-commit.ci log
To fix this add this to your ci:
skip: [pylanguagetool] |
It would be awesome to be able to add this tool to pre-commit hooks. Any plans on adding this?
See https://pre-commit.com/#new-hooks.
The text was updated successfully, but these errors were encountered: