Skip to content

Dockerized version of RuboCop, Ruby static code analyser

Notifications You must be signed in to change notification settings

codenio/docker-rubocop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

docker-rubocop

RuboCop

RuboCop is a Ruby static code analyzer. Out of the box it will enforce many of the guidelines outlined in the community Ruby Style Guide.

Quick reference

visit these links for the full documentation, arguments, and guides.

Usage

docker run \
--interactive --tty --rm \
--volume $PWD:/code \
coder95/rubocop --help

or

$ docker run -it --rm --name rubocop coder95/rubocop -h

or

$  alias rubocop="docker run -it --rm -v $PWD:/code --name rubocop coder95/rubocop"
$  rubocop -h

This shell alias make it simpler and you feel no difference from using the gem.

Available options are:

Usage: rubocop [options] [file1, file2, ...]
-L, --list-target-files          List all files RuboCop will inspect.
    --except [COP1,COP2,...]     Disable the given cop(s).
    --only [COP1,COP2,...]       Run only the given cop(s).
    --only-guide-cops            Run only cops for rules that link to a
                                 style guide.
-c, --config FILE                Specify configuration file.
    --auto-gen-config            Generate a configuration file acting as a
                                 TODO list.
    --exclude-limit COUNT        Used together with --auto-gen-config to
                                 set the limit for how many Exclude
                                 properties to generate. Default is 15.
    --force-exclusion            Force excluding files specified in the
                                 configuration `Exclude` even if they are
                                 explicitly passed as arguments.
    --ignore-parent-exclusion    Prevent from inheriting AllCops/Exclude from
                                 parent folders.
    --force-default-config       Use default configuration even if configuration
                                 files are present in the directory tree.
    --no-offense-counts          Do not include offense counts in configuration
                                 file generated by --auto-gen-config.
-f, --format FORMATTER           Choose an output formatter. This option
                                 can be specified multiple times to enable
                                 multiple formatters at the same time.
                                   [p]rogress (default)
                                   [s]imple
                                   [c]lang
                                   [d]isabled cops via inline comments
                                   [fu]ubar
                                   [e]macs
                                   [j]son
                                   [h]tml
                                   [fi]les
                                   [o]ffenses
                                   [w]orst
                                   [t]ap
                                   [q]uiet
                                   custom formatter class name
-o, --out FILE                   Write output to a file instead of STDOUT.
                                 This option applies to the previously
                                 specified --format, or the default format
                                 if no format is specified.
-r, --require FILE               Require Ruby file.
    --fail-level SEVERITY        Minimum severity (A/R/C/W/E/F) for exit
                                 with error code.
    --show-cops [COP1,COP2,...]  Shows the given cops, or all cops by
                                 default, and their configurations for the
                                 current directory.
-F, --fail-fast                  Inspect files in order of modification
                                 time and stop after the first file
                                 containing offenses.
-C, --cache FLAG                 Use result caching (FLAG=true) or don't
                                 (FLAG=false), default determined by
                                 configuration parameter AllCops: UseCache.
-d, --debug                      Display debug info.
-D, --[no-]display-cop-names     Display cop names in offense messages.
                                 Default is true.
-E, --extra-details              Display extra details in offense messages.
-S, --display-style-guide        Display style guide URLs in offense messages.
-R, --rails                      Run extra Rails cops.
-l, --lint                       Run only lint cops.
-a, --auto-correct               Auto-correct offenses.
    --[no-]color                 Force color output on or off.
-v, --version                    Display version.
-V, --verbose-version            Display verbose version.
-P, --parallel                   Use available CPUs to execute inspection in
                                 parallel.
-s, --stdin FILE                 Pipe source from STDIN, using FILE in offense
                                 reports. This is useful for editor integration.

Example 1 :

$ cd my/cool/ruby/project
$ docker run -it --rm -v $PWD:/code --name rubocop coder95/rubocop

or

$ cd my/cool/ruby/project
$ alias rubocop="docker run -it --rm -v $PWD:/code --name rubocop coder95/rubocop"
$ rubocop

About

Dockerized version of RuboCop, Ruby static code analyser

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published