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

ci: set up lint job using pre-commit/action #238

Merged
merged 9 commits into from
Jul 16, 2024
Merged

ci: set up lint job using pre-commit/action #238

merged 9 commits into from
Jul 16, 2024

Conversation

afuetterer
Copy link
Contributor

This is also in preparation of replacing flake8 and black with ruff (#232).

There are a few issues with the code base regarding its own pre-commit config.

black and the end-of-file-fixer want to fix a few files.

Should these changes be a separate PR?

@MaartenGr
Copy link
Owner

I'm alright with handling that in this PR since it's not that big yet but since it's your PR, you can choose!

@afuetterer
Copy link
Contributor Author

If you are alright with having one commit in the repository with failed CI, I suggest merging this PR and having another PR to handle the lint issues. That way, you can ignore the commit as suggested in bertopic by @freddyheppell.

@freddyheppell
Copy link

I think it would potentially be easier to enable the precommit CI and switch to Ruff all in this PR. Although Ruff and Black/Flake8 will theoretically have quite similar standards, they won't be precisely the same, so I don't see the point of fixing before switching to Ruff.

Also, the blame ignore thing isn't absolute. It will still attribute changes to an ignored commit if the code was genuinely introduced by that commit (e.g. the lint workflow I added to BERTopic will still be attributed to that commit, as there is no alternative). So it's fine to do it all in one PR.

@afuetterer afuetterer marked this pull request as draft June 26, 2024 18:45
@afuetterer

This comment was marked as resolved.

@afuetterer

This comment was marked as resolved.

keybert/_llm.py Outdated Show resolved Hide resolved
keybert/_model.py Outdated Show resolved Hide resolved
keybert/llm/_textgenerationinference.py Outdated Show resolved Hide resolved
@@ -89,3 +89,27 @@ Repository = "https://github.com/MaartenGr/KeyBERT.git"
[tool.setuptools.packages.find]
include = ["keybert*"]
exclude = ["tests"]

[tool.ruff]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used the same config settings as in Bertopic to achieve similar results.

keybert/backend/_spacy.py Show resolved Hide resolved
@afuetterer afuetterer marked this pull request as ready for review July 11, 2024 12:04
@afuetterer
Copy link
Contributor Author

Could you insert the descriptions in the docstrings @MaartenGr? You know best what these parameters are supposed to be.

keybert/_llm.py Outdated Show resolved Hide resolved
keybert/_llm.py Outdated Show resolved Hide resolved
keybert/_model.py Outdated Show resolved Hide resolved
keybert/_model.py Outdated Show resolved Hide resolved
keybert/llm/_textgenerationinference.py Outdated Show resolved Hide resolved
@MaartenGr
Copy link
Owner

Added suggestions to the TODO docstrings which you can choose to add directly or adjust accordingly if they are not descriptive enough.

afuetterer and others added 5 commits July 15, 2024 12:31
Co-authored-by: Maarten Grootendorst <[email protected]>
Co-authored-by: Maarten Grootendorst <[email protected]>
Co-authored-by: Maarten Grootendorst <[email protected]>
Co-authored-by: Maarten Grootendorst <[email protected]>
@afuetterer
Copy link
Contributor Author

If it is alright with you, this can be squashed and merged.

@MaartenGr
Copy link
Owner

@afuetterer Awesome, thank you for the work on this. It is greatly appreciated 😄

@MaartenGr MaartenGr merged commit d8c2487 into MaartenGr:master Jul 16, 2024
6 checks passed
@afuetterer afuetterer deleted the ci-pre-commit branch July 16, 2024 11:35
MaartenGr pushed a commit that referenced this pull request Jul 16, 2024
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.

3 participants