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 pre-commit config to provide feedback on code quality before pushing #17

Merged
merged 16 commits into from
Feb 15, 2024

Conversation

hungdtrn
Copy link
Contributor

In pre-commit config, I use the following hook

  • pre-commit hooks:
    • trailing-whitespace
    • end-of-file-fixer
    • check-byte-order-marker
    • check-added-large-files
    • check-shebang-scripts-are-executable
  • ruff hook

@nqngo
Copy link
Collaborator

nqngo commented Feb 14, 2024

Add Ruff, pre-commit plugins to the VSCode devcontainer.

Add Ruff, pre-commit to dev dependencies.

Specify pre-commit to install on post-install step.

Update from python 3.10 to python 3.12.

Ensure the poetry.lock file is now consistent with pyproject.toml.

@hungdtrn
Copy link
Contributor Author

hungdtrn commented Feb 14, 2024

@nqngo can you clarify "Specify pre-commit to install on post-install step"? Do you mean that I should write a hook on "post-install" event for pre-commit install?

@hungdtrn
Copy link
Contributor Author

@nqngo I realized that the changes I made had already been done last night

@nqngo
Copy link
Collaborator

nqngo commented Feb 15, 2024

@nqngo can you clarify "Specify pre-commit to install on post-install step"? Do you mean that I should write a hook on "post-install" event for pre-commit install?

My bad. The comment was around what has been done on my commit and not a task list. Just to clarify what I've setup.

poetry.lock Outdated Show resolved Hide resolved
Copy link
Contributor

@samhwang samhwang left a comment

Choose a reason for hiding this comment

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

Add a few scripts in the poetry config file to run ruff, so we can also run it manually.

https://python-poetry.org/docs/cli/#run

.pre-commit-config.yaml Outdated Show resolved Hide resolved
@hungdtrn
Copy link
Contributor Author

Add a few scripts in the poetry config file to run ruff, so we can also run it manually.

https://python-poetry.org/docs/cli/#run

Do you have any example of the custom script? I don't know why do we need to have some custom script for running ruff.

@samhwang
Copy link
Contributor

Do you have any example of the custom script? I don't know why do we need to have some custom script for running ruff.

Ignore my previous comment 😓 I had a look at poetry from the npm world and thought we can define custom scripts so you don't have to type in poetry run ruff check . repeatedly.

pyproject.toml Outdated Show resolved Hide resolved
@hungdtrn hungdtrn requested a review from samhwang February 15, 2024 05:21
pyproject.toml Outdated Show resolved Hide resolved
@samhwang samhwang merged commit 33df26c into main Feb 15, 2024
1 check passed
@samhwang samhwang deleted the ollama branch February 15, 2024 08:46
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