rojopolis / spellcheck-github-actions

Spell check action
MIT License
132 stars 38 forks source link

Make pre-commit hook out of this repository #188

Open Lasica opened 10 months ago

Lasica commented 10 months ago

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 commented 10 months ago

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

Lasica commented 10 months ago

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

Lasica commented 10 months ago

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/?

jonasbn commented 10 months ago

Hi @Lasica

Sounds like it.

Lasica commented 10 months ago

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?