Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.97 KB

linters.md

File metadata and controls

34 lines (23 loc) · 1.97 KB

ConanCenterIndex Linters

Some linter configuration files are available in the folder linter, which are executed by Github Actions and are displayed during code review as annotations, to improve recipe quality. They consume python scripts which are executed to fit CCI rules. Those scripts use astroid and pylint classes to parse Conan recipe files and manage their warnings and errors.

Pylint by itself is not able to find ConanCenterIndex rules, so astroid is used to iterate over a conanfile's content and validate CCI requirements. Pylint uses an rcfile to configure plugins, warnings and errors which should be enabled or disabled.

Contents

Understanding the different linters

There's a three classes of linters currently in place for ConanCenterIndex

  • ConanCenter Hook - these are responsible for validating the structure of the recipes and packages.
  • Pylint Linter - these are used to ensure the code quality and conventions of a recipes (i.e conanfile.py)
  • Yaml Checks - stylistic guidance and schema validation check for support files and best practices

Running the linters locally

Check the Developing Recipes for more information on each of the three linters.

Pylint configuration files

  • Pylint Recipe: This rcfile lists plugins and rules to be executed over all recipes (not test package) and validate them.
  • Pylint Test Package Recipe: This rcfile lists plugins and rules to be executed over all recipes in test package folders only: