Rubocop is a Ruby linter and formatter.
As a linter, it checks for aspects such as:
- Style: mosty the recommendations from the Ruby Style Guide;
- Linting: ambiguous ranges, debugger calls, etc.
- Code metrics: cyclomatic and perceieved complexity, the length of the module and methods, etc.;
- Naming: uniform names for constants, methods, modules, etc.
- Security: unsafe evaluation, YAML deserializations, calls to I/O functions, etc.
- Bundling: usual issues in the Bundler files.
The formatter capability can be used to fix many of the issues automatically.
Notice: If you want to view the officially recommended method of installing of the tool, refer to the RuboCop documentation.
- Clone this repository:
git clone https://github.com/canonical/rubocop-snap
- Move into the cloned repository:
cd rubocop-snap
- Install Snapcraft:
sudo snap install snapcraft --classic
- Build the snap:
snapcraft --verbose
- Install the snap:
snap install --dangerous ./rubocop_*.snap
- Test the snap by running the
rubocop
command:rubocop