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

Add haskell language support to pre-commit. #2932

Merged
merged 1 commit into from
Jul 22, 2023

Conversation

alunduil
Copy link
Contributor

I'm attempting to follow the other languages and documentation in CONTRIBUTING (which seems outdated) to add Haskell support to pre-commit so I can add hooks for several useful Haskell tools.

I'm running into issues when trying to run tests of my new language, and I'm trying to figure out where I'm going wrong. Can someone provide guidance?

I'm assuming the system has Haskell installed already, the same as Python and attempting to follow the documented interface in CONTRIBUTING as well as I can without adding too many things for a first pass. I'm hitting strange errors where my mock project can be listed, but it seems to be something other than the CWD for the installation (no project file found to do the install of '.').

Please let me know if there is more up-to-date documentation or something I should try. Once I pass the tests, I'll be ready for deeper integration with some tools to see how things go.

@alunduil alunduil force-pushed the haskell-language branch 2 times, most recently from 9a0d441 to dd611ea Compare July 18, 2023 19:25
.devcontainer/devcontainer.json Outdated Show resolved Hide resolved
testing/resources/python_hooks_repo/build/lib/foo.py Outdated Show resolved Hide resolved
tests/languages/haskell_test.py Outdated Show resolved Hide resolved
tests/languages/haskell_test.py Outdated Show resolved Hide resolved


class TestRunLanguage:
def test_run_example_executable(self, example: pathlib.Path) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't bother with typing in tests -- if the test were going to fail it's already going to fail

pre_commit/languages/haskell.py Outdated Show resolved Hide resolved
pre_commit/languages/haskell.py Outdated Show resolved Hide resolved
pre_commit/languages/haskell.py Outdated Show resolved Hide resolved
pre_commit/languages/haskell.py Outdated Show resolved Hide resolved
pre_commit/languages/haskell.py Outdated Show resolved Hide resolved
@alunduil alunduil force-pushed the haskell-language branch 6 times, most recently from 371941c to 924c0f0 Compare July 19, 2023 20:51
@alunduil alunduil marked this pull request as ready for review July 20, 2023 07:50
@alunduil
Copy link
Contributor Author

@asottile, thanks for the pointers. Let me know if you have any other stylistic or architectural guidance. This is now passing, and I am confident I do what I need to start playing with other repositories to add hooks for this language.

@asottile
Copy link
Member

I reworked it a little bit, picked a smaller test dependency, and updated it to match the structure of the rest of the languages and language tests

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asottile asottile enabled auto-merge July 22, 2023 20:30
@asottile asottile merged commit 2bffc0a into pre-commit:main Jul 22, 2023
43 checks passed
@alunduil alunduil deleted the haskell-language branch July 23, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants