Skip to content

Commit

Permalink
Run rake generate_cops_documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pocke authored and bbatsov committed Jan 20, 2017
1 parent 69db64e commit 08217fe
Show file tree
Hide file tree
Showing 6 changed files with 657 additions and 56 deletions.
52 changes: 52 additions & 0 deletions manual/cops_lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ do_something *some_array
do_something(*some_array)
```

### References

* [https://github.com/bbatsov/ruby-style-guide#method-invocation-parens](https://github.com/bbatsov/ruby-style-guide#method-invocation-parens)

## Lint/AmbiguousRegexpLiteral

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -84,6 +88,10 @@ Attribute | Value
AllowSafeAssignment | true


### References

* [https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition](https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition)

## Lint/BlockAlignment

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -229,6 +237,10 @@ if some_condition
end
```

### References

* [https://github.com/bbatsov/ruby-style-guide#same-line-condition](https://github.com/bbatsov/ruby-style-guide#same-line-condition)

## Lint/Debugger

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -725,6 +737,10 @@ ensure
end
```
### References
* [https://github.com/bbatsov/ruby-style-guide#no-return-ensure](https://github.com/bbatsov/ruby-style-guide#no-return-ensure)
## Lint/FloatOutOfRange
Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -818,6 +834,10 @@ rescue
end
```
### References
* [https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions](https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions)
## Lint/ImplicitStringConcatenation
Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -1059,6 +1079,10 @@ until some_condition
end
```

### References

* [https://github.com/bbatsov/ruby-style-guide#loop-with-break](https://github.com/bbatsov/ruby-style-guide#loop-with-break)

## Lint/MultipleCompare

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -1125,6 +1149,10 @@ def foo
end
```
### References
* [https://github.com/bbatsov/ruby-style-guide#no-nested-methods](https://github.com/bbatsov/ruby-style-guide#no-nested-methods)
## Lint/NextWithoutAccumulator
Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -1212,6 +1240,10 @@ puts (x + y)
puts(x + y)
```
### References
* [https://github.com/bbatsov/ruby-style-guide#parens-no-spaces](https://github.com/bbatsov/ruby-style-guide#parens-no-spaces)
## Lint/PercentStringArray
Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -1346,6 +1378,10 @@ rescue ArgumentError
end
```
### References
* [https://github.com/bbatsov/ruby-style-guide#no-blind-rescues](https://github.com/bbatsov/ruby-style-guide#no-blind-rescues)
## Lint/SafeNavigationChain
Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -1474,6 +1510,10 @@ which is redundant.
"result is #{something}"
```
### References
* [https://github.com/bbatsov/ruby-style-guide#no-to-s](https://github.com/bbatsov/ruby-style-guide#no-to-s)
## Lint/UnderscorePrefixedVariableName
Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -1676,6 +1716,10 @@ IgnoreEmptyBlocks | true
AllowUnusedKeywordArguments | false


### References

* [https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars](https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)

## Lint/UnusedMethodArgument

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -1709,6 +1753,10 @@ AllowUnusedKeywordArguments | false
IgnoreEmptyMethods | true


### References

* [https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars](https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)

## Lint/UselessAccessModifier

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -1847,6 +1895,10 @@ def some_method
end
```

### References

* [https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars](https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)

## Lint/UselessComparison

Enabled by default | Supports autocorrection
Expand Down
21 changes: 20 additions & 1 deletion manual/cops_metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ configured maximum. The ABC size is based on assignments, branches

Attribute | Value
--- | ---
Reference | http:https://c2.com/cgi/wiki?AbcMetric
Max | 15


### References

* [http:https://c2.com/cgi/wiki?AbcMetric](http:https://c2.com/cgi/wiki?AbcMetric)

## Metrics/BlockLength

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -61,6 +64,10 @@ CountBlocks | false
Max | 3


### References

* [https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count](https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count)

## Metrics/ClassLength

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -124,6 +131,10 @@ IgnoreCopDirectives | false
IgnoredPatterns |


### References

* [https://github.com/bbatsov/ruby-style-guide#80-character-limits](https://github.com/bbatsov/ruby-style-guide#80-character-limits)

## Metrics/MethodLength

Enabled by default | Supports autocorrection
Expand All @@ -142,6 +153,10 @@ CountComments | false
Max | 10


### References

* [https://github.com/bbatsov/ruby-style-guide#short-methods](https://github.com/bbatsov/ruby-style-guide#short-methods)

## Metrics/ModuleLength

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -179,6 +194,10 @@ Max | 5
CountKeywordArgs | true


### References

* [https://github.com/bbatsov/ruby-style-guide#too-many-params](https://github.com/bbatsov/ruby-style-guide#too-many-params)

## Metrics/PerceivedComplexity

Enabled by default | Supports autocorrection
Expand Down
78 changes: 38 additions & 40 deletions manual/cops_performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,9 @@ str.casecmp('ABC').zero?
'abc'.casecmp(str).zero?
```

### Important attributes

Attribute | Value
--- | ---
Reference | https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code
### References

* [https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code](https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code)

## Performance/CompareWithBlock

Expand Down Expand Up @@ -200,10 +197,13 @@ considered unsafe.

Attribute | Value
--- | ---
Reference | https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code
SafeMode | true


### References

* [https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code](https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code)

## Performance/DoubleStartEndWith

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -257,10 +257,13 @@ would suffice.

Attribute | Value
--- | ---
Reference | https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
AutoCorrect | false


### References

* [https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end](https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end)

## Performance/FixedSize

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -294,10 +297,13 @@ This cop is used to identify usages of

Attribute | Value
--- | ---
Reference | https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code
EnabledForFlattenWithoutParams | false


### References

* [https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code](https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code)

## Performance/HashEachMethods

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -327,6 +333,10 @@ Attribute | Value
AutoCorrect | false


### References

* [https://github.com/bbatsov/ruby-style-guide#hash-each](https://github.com/bbatsov/ruby-style-guide#hash-each)

## Performance/LstripRstrip

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -364,12 +374,9 @@ desired result:

('a'..'z').cover?('yellow') # => true

### Important attributes

Attribute | Value
--- | ---
Reference | https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code
### References

* [https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code](https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code)

## Performance/RedundantBlockCall

Expand Down Expand Up @@ -400,12 +407,9 @@ def another
end
```

### Important attributes

Attribute | Value
--- | ---
Reference | https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
### References

* [https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code](https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code)

## Performance/RedundantMatch

Expand Down Expand Up @@ -451,10 +455,13 @@ hash.merge!(a: 1, b: 2)

Attribute | Value
--- | ---
Reference | https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code
MaxKeyValuePairs | 2


### References

* [https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code](https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code)

## Performance/RedundantSortBy

Enabled by default | Supports autocorrection
Expand Down Expand Up @@ -561,12 +568,9 @@ change them to use `reverse_each` instead.
[].reverse_each
```

### Important attributes

Attribute | Value
--- | ---
Reference | https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code
### References

* [https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code](https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code)

## Performance/Sample

Expand Down Expand Up @@ -599,12 +603,9 @@ and `shuffle[]` and change them to use `sample` instead.
[1, 2, 3].shuffle(random: Random.new)
```

### Important attributes

Attribute | Value
--- | ---
Reference | https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code
### References

* [https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code](https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code)

## Performance/Size

Expand Down Expand Up @@ -637,12 +638,9 @@ have been assigned to an array or a hash.
[1, 2, 3].count { |e| e > 2 }
```

### Important attributes

Attribute | Value
--- | ---
Reference | https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code
### References

* [https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code](https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code)

## Performance/StartWith

Expand All @@ -669,10 +667,13 @@ This cop identifies unnecessary use of a regex where

Attribute | Value
--- | ---
Reference | https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
AutoCorrect | false


### References

* [https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end](https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end)

## Performance/StringReplacement

Enabled by default | Supports autocorrection
Expand All @@ -698,12 +699,9 @@ This cop identifies places where `gsub` can be replaced by
'a b c'.delete(' ')
```

### Important attributes

Attribute | Value
--- | ---
Reference | https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
### References

* [https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code](https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code)

## Performance/TimesMap

Expand Down
Loading

0 comments on commit 08217fe

Please sign in to comment.