spellcheck-github-actions icon indicating copy to clipboard operation
spellcheck-github-actions copied to clipboard

Make pre-commit hook out of this repository

Open Lasica opened this issue 2 years ago • 5 comments

Hello, I've had a need to add spellchecking to my repo docs. For this purpose I've created my hook definition based on this repository. I think that's probably a small addition that would be welcome and more fitting in this repository directly.

All it takes is properly defined pre-commit-hooks.yml file. Here is sample of what my looks like:

-   id: pyspelling-docker
    name: Pyspelling in docker
    description: Pyspelling with aspell using Dockerfile of github action, based on https://github.com/rojopolis/spellcheck-github-actions
    language: docker_image
    entry: jonasbn/github-action-spellcheck:latest

with readme description of how to configure it:

Define in .pre-commit-config.yaml:

- repo: https://github.com/getindata/py-pre-commit-hooks
  rev: v0.1.3
  hooks:
  - id: pyspelling-docker

What do you think? Do you want PR for this?

Lasica avatar Nov 20 '23 12:11 Lasica

ideally it should not point to latest docker image, rather be updated and fixed on each release

Lasica avatar Nov 20 '23 13:11 Lasica

Just to be clear, I'm aware of pyspelling hook in the other repo. I'm specifically calling for docker contained pyspelling hook.

Lasica avatar Nov 20 '23 14:11 Lasica

Hmm I have some issues using this as a pre-commit hook. Locally I have no problems, however as running pre-commit is part of ci/cd it also gets run at testing pipeline and fails at :

 ERROR: docs/source/03_getting_started/05_authentication.md -- Runtime Error: Error: The file "/src/dictionary.dic" can not be opened for reading.

Is is possible that it's permissions level at the mounted directory to src/?

Lasica avatar Nov 20 '23 15:11 Lasica

Hi @Lasica

Sounds like it.

jonasbn avatar Nov 20 '23 16:11 jonasbn

Yeah I've changed permissions to this file to be writable by everyone and it fixed the issue, although I can't do the same for environment in cicd. It would be better if this file was created and accessed in some tmp directory in docker, maybe?

Lasica avatar Nov 20 '23 17:11 Lasica