File: roodi.1

package info (click to toggle)
roodi 5.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 424 kB
  • sloc: ruby: 1,922; makefile: 4
file content (71 lines) | stat: -rw-r--r-- 2,282 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.TH ROODI 1

.SH NAME
roodi - Roodi stands for Ruby Object Oriented Design Inferometer.

.SH SYNOPSIS
\fBroodi\fP [\fIoptions\fP] [\fIpattern\fP ...]

.SH DESCRIPTION
\fBRoodi\fP stands for Ruby Object Oriented Design Inferometer. It parses your
Ruby code and warns you about design issues you have based on the checks
that is has configured.

.SH OPTIONS

.TP
\fB-config=\fP\fIconfig-file\fP
Provide your own \fIconfig-file\fP.
The \fIconfig-file\fP is a YAML file that lists the checks to be included. Each check
can optionally include a hash of options that are passed to the check to configure it.
For example, the default config file looks like this:

  AssignmentInConditionalCheck:    { }
  CaseMissingElseCheck:            { }
  ClassLineCountCheck:             { line_count: 300 }
  ClassNameCheck:                  { pattern: !ruby/regexp /^[A-Z][a-zA-Z0-9]*$/ }
  CyclomaticComplexityBlockCheck:  { complexity: 4 }
  CyclomaticComplexityMethodCheck: { complexity: 8 }
  EmptyRescueBodyCheck:            { }
  ForLoopCheck:                    { }
  MethodLineCountCheck:            { line_count: 20 }
  MethodNameCheck:                 { pattern: !ruby/regexp /^[_a-z<>=\\[\\]|+-\/\\*`]+[_a-z0-9_<>=~@\\[\\]]*[=!\\?]?$/ }
  ModuleLineCountCheck:            { line_count: 300 }
  ModuleNameCheck:                 { pattern: !ruby/regexp /^[A-Z][a-zA-Z0-9]*$/ }
  ParameterNumberCheck:            { parameter_count: 5 }

.SH EXAMPLE USAGE

Check all ruby files in a rails app:
    roodi "rails_app/**/*.rb"

Check one controller and one model file in a rails app:
    roodi app/controller/sample_controller.rb app/models/sample.rb

Check one controller and all model files in a rails app:
    roodi app/controller/sample_controller.rb "app/models/*.rb"

Check all ruby files in a rails app with a custom configuration file:
    roodi \-config=my_roodi_config.yml "rails_app/**/*.rb"

If you're writing a check, it is useful to see the structure of a file the way that Roodi tokenizes it (via ruby_parser). Use:
    \fBroodi-describe\fP [filename]
  
.SH SEE ALSO
.BR roodi-describe (1)
.br
.IR http://roodi.rubyforge.org

.SH FILES

.TP
/etc/roodi.yml
Roodi default \fIconfig-file\fP.

.SH AUTHOR
Marty Andrews <marty@cogent.co>

.SH VERSION
\fBRoodi\fP, version 2.2.0
.br