Skip to content
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 pre-commit hook out of this repository #188

Open
Lasica opened this issue Nov 20, 2023 · 5 comments
Open

Make pre-commit hook out of this repository #188

Lasica opened this issue Nov 20, 2023 · 5 comments
Assignees

Comments

@Lasica
Copy link

Lasica commented Nov 20, 2023

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
Copy link
Author

Lasica commented Nov 20, 2023

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

@jonasbn jonasbn self-assigned this Nov 20, 2023
@Lasica
Copy link
Author

Lasica commented Nov 20, 2023

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

@Lasica
Copy link
Author

Lasica commented Nov 20, 2023

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
Copy link
Collaborator

jonasbn commented Nov 20, 2023

Hi @Lasica

Sounds like it.

@Lasica
Copy link
Author

Lasica commented Nov 20, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants