Skip to content

Add Ruff linter and formatter - #17

Merged
jjmerchante merged 2 commits into
chaoss:mainfrom
sduenas:ruff-pre-commit
Nov 13, 2026
Merged

jjmerchante merged 2 commits into
chaoss:mainfrom
sduenas:ruff-pre-commit

Conversation

@sduenas

@sduenas sduenas commented Oct 19, 2026

Copy link
Copy Markdown
Member

As we did in chaoss/grimoirelab-core#62, the idea is to automate formatting and linter tasks so we don't waste our time figuring out what style is best.
This PR adds Ruff to check as formatter and, with the help of pre-commit, every time a new commit is created, the files will be formatted.
CI has been also updated to check if the format is correct after a PR is created.

@sduenas
sduenas requested a review from jjmerchante October 22, 2026 10:39
@sduenas

sduenas commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

@jjmerchante , if you have a minute, can you review this PR?

@jjmerchante jjmerchante left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jjmerchante
jjmerchante self-requested a review November 11, 2026 18:47

@jjmerchante jjmerchante left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

.flake8 is still in the repository

Comment thread chronicler/events/core/git.py Resolved
Comment thread chronicler/eventizer.py Resolved
Comment thread chronicler/events/core/git.py Resolved
Comment thread chronicler/eventizer.py Resolved
@sduenas
sduenas force-pushed the ruff-pre-commit branch 2 times, most recently from 3a3cb24 to 5aea7f7 Compare November 12, 2026 09:08
Santiago Dueñas added 2 commits November 12, 2026 10:09
Apply the formatter to the files of the repository.
This deletes the unnecesarry flake8 package because its
rules are also applied by the formatter.

This commit also includes the installation of pre-commit.
With pre-commit everytime a new commit is created, the
formatter will run and correct the errors.

Signed-off-by: Santiago Dueñas <sduenas@grimoirelab.org>
The linter and the formatter will execute every time the tests
workflow is run.

Signed-off-by: Santiago Dueñas <sduenas@grimoirelab.org>
@sduenas

sduenas commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

@jjmerchante comments addressed

@jjmerchante
jjmerchante merged commit 522221d into chaoss:main Nov 13, 2026
4 of 5 checks passed
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.

2 participants