robota-suite / robota-core

A Python package for reading in elements of GitLab and GitHub repositories, for further analysis.
https://robota-core.readthedocs.io
MIT License
0 stars 9 forks source link

Improve Ruff Usage in CI Workflow #18

Open lourencofsilva opened 6 months ago

lourencofsilva commented 6 months ago

At the moment, Ruff is being used with its default configuration and treating all errors as warnings, so that the action completes and simply displays them.

There are several improvements that can be implemented:

  1. The specific flakes, errors and warnings being check for, as well as all other Ruff config can be manually set in pyproject.toml and it will pick them up automatically.
  2. The action of ruff check can be split into two, where the first one selects only a few specific rules to be checked for and make the action error if these are found (for more severe errors such as syntax errors), and then having a second check for all other desired rules that only serves as warnings (as the current setup does).
  3. A few quick lines of code can be added for Ruff to automatically fix the errors found (those it can fix automatically) and commit these either to the codebase or the pull request, depending on the situation.
suzanneEmbury commented 5 months ago

Thanks for this suggestion, @lourencofsilva . We'll live with Ruff as it is for a bit, and then we can look at this issue and start to configure it to fit what we need more precisely.