Skip to content

Introducing pre-commit formatting of the code #120

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

picjul
Copy link

@picjul picjul commented Apr 6, 2025

Description

Introducing pre-commit formatting to assess code quality before commit. Using black formatter for Python.

Type of change

  • New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

pip install pre-commit
pre-commit install
pre-commit run --all-files

Any specific deployment considerations

Every contributor has to install pre-commit before commiting new changes. This will avoid commits with un-formatted code.

Docs

  • Docs updated? What were the changes:
  • Contributing.md added formatting step before commit

@CLAassistant
Copy link

CLAassistant commented Apr 6, 2025

CLA assistant check
All committers have signed the CLA.

@SkalskiP
Copy link
Collaborator

SkalskiP commented Apr 6, 2025

Hi @picjul 👋🏻 Thanks for your interest in RF-DETR. I'm not sure if introducing this feature like this is good idea. It will make code review incredibly hard. Even small change will end up refactoring whole file. If we do it we should auto-format whole code first.

@picjul
Copy link
Author

picjul commented Apr 6, 2025

OK, I can agree. But sooner or later I think it would be useful to introduce a similar mechanism, either by pre-commit or by introducing a step in Github actions. Why not start doing this now with the project still 'small' in size? 🤔

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