You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to have a way to configure rules per file or directory. I have a global configuration for my project at root, but I have some directories that I want to configure differently.
Example use case: I have some directories in the project that contain outdated code that is being migrated. We decided in the team that we don't want to refactor these tests, yet Robocop still uses the root's configuration for it. I would like to exclude some rules for this specific directory. Having a pyproject.toml or .robocop file in this directory does not affect the project's configuration.
Proposed solution: Add a way to extend the main configuration file for specific files/directories (example how it's done in airflow project with ruff):
One is to have separate configurable file per directory, like somehow described in #606
Second is to have options that allows to extend some of the configurations per file (for example extend exclude for specific files like in your example).
Second should be a lot easier to implement than first, as the first requires more planning if it comes to dealing with multiple configuration files (merging etc), But then we need to clearly define which options could be 'extended'. Extending exclude should be easy, include harder (as it may require reloading the rules), same with keeping separate rule configuration per file.
So I propose we can go with 2) first, and do it only for exclude. Then over the time we can implement 1) option. But I will take a second look if 1) is easier than I think, because it's better option overall from the user perspective.
I would like to have a way to configure rules per file or directory. I have a global configuration for my project at root, but I have some directories that I want to configure differently.
Example use case: I have some directories in the project that contain outdated code that is being migrated. We decided in the team that we don't want to refactor these tests, yet Robocop still uses the root's configuration for it. I would like to exclude some rules for this specific directory. Having a
pyproject.toml
or.robocop
file in this directory does not affect the project's configuration.Proposed solution: Add a way to extend the main configuration file for specific files/directories (example how it's done in
airflow
project withruff
):The text was updated successfully, but these errors were encountered: