A code metric tool for rails projects.
Patterns to include in execution and reports.
Note: Inspecode runs rails_best_practices for each Rails application and the input patterns are used for detecting Rails applications containing input files. Therefore, the files excluded by the patterns are processed if they are contained in applications that also contain input files, and you may even see logs related to the excluded files in the job console. However, Inspecode eventually ignores any issues detected on the excluded files when generating job reports.
If you need to let rails_best_practices ignore particular files, consider specifying
Patterns to exclude from execution and reports.
Note: Just like
input:, the ignore patterns may not be applied completely when running rails_best_practices.
Amount of CPU. The default machine has
0.25 CPU with
960 MiB RAM.
Below is the list of options that are supported:
--vendor include vendor files --spec include spec files --test include test files --features include features files -x, --exclude PATTERNS Don't analyze files matching a pattern (comma-separated regexp list) -o, --only PATTERNS Analyze files only matching a pattern (comma-separated regexp list) -c, --config CONFIG_PATH configuration file location (defaults to config/rails_best_practices.yml)
No tool specific severity levels are available.
Note: The incremental analysis cannot be supported for rails_best_practices. This is because rails_best_practices checks files with considering dependencies between them and the results on unchanged files can be affected by changed files.
No tool specific experimental options are available.
With default options:
inspecode: tools: rails_best_practices: default
With custom machine:
inspecode: tools: rails_best_practices: machine: cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
With custom options:
inspecode: tools: rails_best_practices: options: [--spec, --test]
Inspecode tries to detect Rails applications in your repository and runs rails_best_practices at the root of each Rails application if detected. Otherwise if no Rails applications are detected in your repository, Inspecode runs rails_best_practices at the root of your repository.
Note: Inspecode assumes a Rails application has the following layout:
<rails app>/ |-- app/ |-- config/ |-- public/ |-- Rakefile |-X *.gemspec (should not be a gem) |-- ... (other files and directories)
If no configuration files are specified via
options field, Inspecode first lets rails_best_practices to find configuration files in your repository.
See https://github.com/flyerhzm/rails_best_practices/tree/v1.18.0#other-command-line-options about how rails_best_practices looks for configuration files.
In addition, if rails_best_practices cannot find any configuration files, Inspecode also walks the file tree in lexical order in your repository to find a configuration file named
rails_best_practices.yml and specifies the file first found to rails_best_practices automatically via
Note: Inspecode ignores specific configuration files while searching. See Configuration > Tool Configuration > Field:
If the configuration file detected by Inspecode is not the one you want to use or you do not want to use any configuration files, you can disable Inspecode from detecting configuration files by explicitly setting an empty string to
config-file field like below:
inspecode: tools: rails_best_practices: config-file: ""