Cyclopt Configuration File
Cyclopt provides a configuration file, which allows you to configure some parameters that are taken into consideration while your code is analyzed. This can be done by adding a cyclopt.yaml
file in the root directory.
Template
You can edit the configuration file, based on the template below:
global:
branches_exclude:
- testing_branch
metrics:
exclude:
- /pilots/*
- /src/models/*
- /src/routes/public.js
violations:
exclude:
- Position Literals First In Comparisons
files_ignore:
- /tests/*
config:
max_line_length: 20
modules:
- path: "/tests"
languages:
- Java
metrics:
exclude:
- /data/*
include:
- /pilots/*
violations:
include:
- Position Literals First In Comparisons
exclude:
- Loose Coupling
files_ignore:
- /src/*
files_include:
- /tests/*
Instructions
Global
In global
section, the settings that apply to the whole repository are set.
In this section you may configure the following:
Specific branches can be excluded from the analysis by adding them in
branches_exclude
.You can exclude some files or subdirectories from the metrics analysis. These files/subdirectories will not be taken into account while calculating the metrics.
Moreover, you can exclude some violations from the analysis by adding their name under
violations.exclude
, as it appears in the Violations page in Cyclopt platform (e.g.Position Literals First In Comparisons
as shown in the image below):
It is also feasible to exclude some files or folders from the violations analysis by adding them under the
violations.files_ignore
section. You may also provide some globby patterns, which will be used to identify the files of folders to be excluded from the analysis.Finally, you can add some custom configuration commands for the violation analysis in the
violations.config
section. Currently, the only supported configuration command is the update of the default value for the maximum allowed line length for Python violations, under theviolations.config.max_line_length
command.
Modules
In modules
section, the settings that apply to the specific root that is defined by the path
argument are set. It should be noted that all the settings from the global
section apply to this module/root as well.
In this section you may configure the following:
You may specify the
languages
to be analyzed (in case they differ from the ones of the repository).In
violations
section, you may perform the same actions as in theglobal.violations
section.Additionally, it is possible to
include
some violations in the analysis of this module/root that were previously excluded globally inglobal.violations.exclude
.Finally, you may also include some files, folders or globby patterns (in the
files_include
section) that were also excluded inglobal.violations.files_ignore
.Respectively, in
metrics
sections, you may perform the same actions as in themodules.violations
. You can add the subfolders that you want to exclude for the specific module/rootmetrics.exclude
and the subfolders that you want to include for the specific module/root inmetrics.include
.