avocado-framework / avocado-static-checks

A collection of opinionated scripts that apply static quality checks to (mostly) Python code
Other
0 stars 3 forks source link

Different check profiles/configuration for different parts a repository #5

Closed clebergnu closed 3 months ago

clebergnu commented 9 months ago

For some projects, it may be undesirable to have a single configuration being applied to the entire code base.

Using the autils repository as an example, APIs in the utility modules that will be made public should require docstrings for the module, methods and functions. This is unfair to ask for the modules/classes/methods/functions that implement tests for a given module, as it would require too much boilerplate code just to conform with a lint check.

The idea here is to allow the static-checks to map a pattern or glob to a given configuration. For instance:

The check-lint script should have the ability to look into the parent repository and look for the mapping. Example:

 [autils] $ ls -la1
 ...
 autils
 tests
 static-checks
 .avocado_static_checks.conf
 ...

With .avocado_static_checks.conf containing something like:

[lint]
autils: default_config/pylintrc
tests: default_config/pylintrc_tests

In the absence of such a config file, check-lint should apply a reasonable action, using the default config on all Python files.

richtja commented 3 months ago

Resolved in #8