Skip to content

Conversation

@HicaroD
Copy link

@HicaroD HicaroD commented Jan 8, 2026

Summary

This PR introduces pre-commit hooks to improve code quality and automate testing in the development workflow.

Changes Made

Pre-commit Hook Setup:

  • Added hooks for ruff (linting & formatting), mypy (type checking), and pytest (automated testing)
  • Added pre-commit as a development dependency in pyproject.toml

Documentation Updates:

  • Updated contributing documentation (CONTRIBUTING.md, CONTRIBUTING-pt.md, and docs/contributing.md) to include instructions for installing and using pre-commit hooks

CI/CD Integration:

  • Added new ci command in pyproject.toml for better code quality checking in continuous integration
  • Updated GitHub Actions workflow (.github/workflows/code-quality-gate.yaml) to use the new CI command

Code Quality Fixes:

  • Fixed type annotations to satisfy mypy linter
  • Improved error handling types for mypy compliance

@JoaquimCassano
Copy link
Member

Looks good, but I don't really get the changes of the HTTP status types (from literal to int). Why?

@HicaroD
Copy link
Author

HicaroD commented Jan 18, 2026

For some reason, linter was not really happy about those literals, but you could keep it and ignore the linter error.

If you go back to the literal implementation and execute the pre-commit checks, you will see that mypy will complain about it.

@JoaquimCassano
Copy link
Member

I think it'd be better, tbh

@HicaroD
Copy link
Author

HicaroD commented Jan 19, 2026

It is certainly cleaner for us humans, I can revert these changes and ignore the linter errors for the sake of readability.

What do you think?

@JoaquimCassano
Copy link
Member

I think it would be nice!

@HicaroD
Copy link
Author

HicaroD commented Jan 19, 2026

Done, @JoaquimCassano

So I was able to still use the literals and ensure code quality checks with Mypy without ignoring the linter errors, which is way better.

Note: Also those weird changes on other files were not done by hand, they were caused by Ruff formatting

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