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 code quality checks #23

Closed
4 of 6 tasks
Zaubeerer opened this issue Sep 28, 2023 · 3 comments · Fixed by #31
Closed
4 of 6 tasks

Set up code quality checks #23

Zaubeerer opened this issue Sep 28, 2023 · 3 comments · Fixed by #31

Comments

@Zaubeerer
Copy link
Collaborator

Zaubeerer commented Sep 28, 2023

In order to assure good code quality, we will implement the following code quality checks:

First MR:

  • set up pre-commit hooks
    • black
    • ruff

Second MR:

Originally posted by @mt7180 in #19 (comment)

@mt7180
Copy link
Owner

mt7180 commented Oct 1, 2023

Just for the sake of documentation, here is what chatgpt tells about the suggested code quality checks:

  1. First MR (Merge Request):

    • The goal of this MR is to implement code quality checks to ensure good code quality.
    • "set up pre-commit hooks": This implies that you'll be configuring pre-commit hooks in your code repository. Pre-commit hooks are scripts or actions that run automatically before a commit is allowed. They are used to enforce code formatting, linting, and other quality checks.
    • "black": Black is a popular code formatter for Python. It enforces a consistent code style by automatically formatting your code.
    • "ruff": It's possible that "ruff" is a custom linting or code quality tool specific to your project. It could be something developed in-house or a tool with a similar purpose to check code quality.
  2. Second MR (Merge Request):

    • The goal of this MR is to set up GitHub Actions, which are workflows that automate tasks like building, testing, and deploying your code on the GitHub platform.
    • "black" and "ruff" are mentioned again, suggesting that in this MR, you'll likely configure GitHub Actions to run code formatting (black) and code quality checks (ruff) as part of your automated workflow.

In summary, both Merge Requests are focused on enhancing code quality in your project. The first one sets up pre-commit hooks to ensure code quality before commits, and the second one sets up GitHub Actions to automate code quality checks and formatting as part of your continuous integration (CI) process. "MR" refers to the process of proposing changes to the codebase, which typically includes code reviews before the changes are merged into the main codebase.

@mt7180
Copy link
Owner

mt7180 commented Oct 2, 2023

Hey @Zaubeerer : My research led me to the following pre-commit configuration, what do you think, is that what you had in mind?

.pre_commit-config.yaml

repos:
  # taken from: https://black.readthedocs.io/en/stable/integrations/source_version_control.html
  # Using this mirror lets us use mypyc-compiled black, which is about 2x faster
  - repo: https://github.com/psf/black-pre-commit-mirror
    rev: 23.9.1
    hooks:
      - id: black
        # It is recommended to specify the latest version of Python
        # supported by your project here, or alternatively use
        # pre-commit's default_language_version, see
        # https://pre-commit.com/#top_level-default_language_version
        language_version: python3.10
# taken from: https://pypi.org/project/ruff/
- repo: https://github.com/astral-sh/ruff-pre-commit
  rev: v0.0.291
  hooks:
    - id: ruff
   

@mt7180 mt7180 linked a pull request Oct 2, 2023 that will close this issue
@Zaubeerer
Copy link
Collaborator Author

Yes, looks good :)

Feel free to install it and create a PR 👍

@mt7180 mt7180 mentioned this issue Oct 10, 2023
3 tasks
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 a pull request may close this issue.

2 participants