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

Set up pre-commit hooks #2283

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

afuetterer
Copy link
Contributor

@afuetterer afuetterer commented Feb 7, 2025

What does this PR do?

Fixes #2274

I used the same config like the KeyBERT repo, but updated the hooks versions. Should the extra lint ci job be removed? I did not want to remove it without asking for permission.

This now leads to a lot of "trailing whitespace" fixes. Also there are a few findings from ruff.

Do you want (me) to fix those in this PR?

  • remove extra lint ci job
  • rebase
  • ignore html and svg files in end-of-file-fixer hook
  • fix linting issues
  • fix ruff issues
  • add commit sha to ignore file (once PR is merged)

Before submitting

  • Did you read the contributor guideline?
  • Was this discussed/approved via a Github issue? Please add a link to it if that's the case.

@afuetterer
Copy link
Contributor Author

For comparison: The lint step using the pre-commit hooks (without installing BERTopic itself) took 22 seconds, whereas the lint job (with installing BERTopic and dev dependencies) took 3m 11s.

@MaartenGr
Copy link
Owner

I used the same config like the KeyBERT repo, but updated the hooks versions. Should the extra lint ci job be removed? I did not want to remove it without asking for permission.

Sounds good.

This now leads to a lot of "trailing whitespace" fixes.

Ah, I was wondering why there were suddenly so many changes!

Do you want (me) to fix those in this PR?

Yeah, considering this influences the tests, let's fix them here, thanks!

@afuetterer afuetterer marked this pull request as draft February 11, 2025 15:35
@afuetterer afuetterer force-pushed the pre-commit branch 3 times, most recently from 4473605 to a5b10bd Compare February 17, 2025 19:51
@afuetterer
Copy link
Contributor Author

A pre-commit hook wants to add a newline to the HTML files. Accept or ignore?

@MaartenGr
Copy link
Owner

A pre-commit hook wants to add a newline to the HTML files. Accept or ignore?

Let's ignore that one.

@afuetterer afuetterer marked this pull request as ready for review February 19, 2025 08:10
@afuetterer
Copy link
Contributor Author

All done. Rebased to master.

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

Successfully merging this pull request may close these issues.

Set up pre-commit hook(s)
2 participants