certtools / intelmq

IntelMQ is a solution for IT security teams for collecting and processing security feeds using a message queuing protocol.
https://docs.intelmq.org/latest/
GNU Affero General Public License v3.0
975 stars 296 forks source link

Introduce strong formatting & linting aka black/ruff #2515

Open kamil-certat opened 4 months ago

kamil-certat commented 4 months ago

IntelMQ has a very weak formatting/linting rules what is not a typical thing in modern development, where projects tend to provide strict & automated formatting to keep the code style consistent.

Especially in Python world, there is a general movement last years to implement the black formatter, and currently most black-compatible ruff formatter, which also replace some other tools, like isort.

I'd like to introduce ruff with import sorting enabled in IntelMQ. This would provide a consistent code style without much developer action required as black/ruff enforces the style automatically. The code style is compliant with PEP8, and in addition lowers the number of git conflicts, removes unused imports, and can be fully configured to support any of our style configurations.