Commit graph

312 commits

Author SHA1 Message Date
V. Elenhaupt
fd78d17c40
New rule: Performance/FirstLastAfterFilter (#76) 2018-09-06 17:59:11 +03:00
Vitalii Elenhaupt
a1b34eb7be
New rule: Performance/AnyAfterFilter 2018-09-03 22:55:10 +03:00
Vitalii Elenhaupt
068733a9d3
Correct yaml configuration examples in docs 2018-09-03 22:53:11 +03:00
Vitalii Elenhaupt
790b519653
Performance/Count -> Performance/SizeAfterFilter 2018-09-03 22:44:30 +03:00
Vitalii Elenhaupt
799c0fd5e1
Correct location name of reported issue 2018-09-03 13:26:19 +03:00
Vitalii Elenhaupt
9fa13848bf
Correct doc example for Count rule 2018-09-03 12:00:23 +03:00
Vitalii Elenhaupt
446f557c23
New rule: Performance/Count 2018-09-03 01:07:34 +03:00
Vitalii Elenhaupt
f4680a75f4
Apply default formatting 2018-09-03 00:17:56 +03:00
Vitalii Elenhaupt
248c5a656b
Add --all cli flag that enables all available rules 2018-07-04 15:20:35 +03:00
Vitalii Elenhaupt
970ca4be1b
Disable PredicateName and LargeNumbers rules by default 2018-07-04 14:11:24 +03:00
Vitalii Elenhaupt
dbac46b68a
Ignore outer shadowing of throwaway variables
closes #67
2018-06-25 17:02:46 +03:00
V. Elenhaupt
fafc5f4bdc
Allow filtering by group name (#65) 2018-06-18 10:25:06 +03:00
V. Elenhaupt
4cb5328513
Add rule namespaces: style, lint, layout (#63) 2018-06-16 14:50:59 +03:00
Vitalii Elenhaupt
f8d14d4222 Rename Error to Issue 2018-06-12 12:55:56 +03:00
Vitalii Elenhaupt
e1b51f62a5
Exclude file pattern match
closes #61
2018-05-29 13:19:00 +03:00
Vitalii Elenhaupt
c12b4f1aa5 Shadowed argument 2018-05-29 09:47:32 +03:00
Vitalii Elenhaupt
15bb8f5331 Detect shadowing outer local vars 2018-05-29 09:47:20 +03:00
Vitalii Elenhaupt
3887da1438 Redundant begin: do not report if there is an inner handler
fixes #56
2018-05-25 11:23:11 +03:00
Vitalii Elenhaupt
1cea21b147
Do not report float numbers as large if fraction has less than 3 digits 2018-05-13 19:04:15 +03:00
Vitalii Elenhaupt
7a4fcec5ce
Prefer Tuple over Array to format a message to reduce GC 2018-05-13 14:59:30 +03:00
Vitalii Elenhaupt
402a0c0dab
Unused argument name suggession 2018-05-13 14:13:57 +03:00
Vitalii Elenhaupt
415432713a
Prevent false positiveness cause by macro literals
https://github.com/crystal-lang/crystal/pull/6055#issuecomment-386376227
2018-05-12 17:37:54 +03:00
Vitalii Elenhaupt
1fc0c525bd
Do not report unneeded disable directive if directive is used one line above 2018-05-09 00:14:46 +03:00
Vitalii Elenhaupt
c7fc905413
Mark the internal visitor class as private 2018-05-08 22:23:01 +03:00
V. Elenhaupt
c2aa526e21
Unused argument rule (#52)
* Unused argument rule

* IgnoreDefs, IgnoreBlocks, IgnoreProcs parameters

* Implicit reference by super keyworkd

* Handle macro arguments
2018-05-08 22:00:17 +03:00
V. Elenhaupt
6475c2bb25
Variable scope & useless assignments (#41)
* AST::Visitor -> AST::NodeVisitor

* Scope & ScopeVisitor

* Useless assignment rule

* Instance vars and useless assignments

* Multiple assigns one by one

* Support outer scope

* Variable used in the useless assignment

* Support OpAssign & MultiAssign

* Captured by block

* Variable, Assignment, Reference & Refactoring

* Variable has references, Assignment can be referenced

* Branch entity

* Handle useless assignments in branches

* Handle assignments in a loop

* Handle branch equality

* Handle special var `$?` assignment

* Improve captured by block stuff

* Avoid assignments in property definitions

(UselessAssign rule reports an warning)

* Support MacroIf and MacroFor branches

* Handle assignments with shadowed vars in inner scopes

* Add method arguments as scope variables

* Handle case if branch is blank

* Top level scope

* Handle case when branch is nop?
2018-05-03 18:57:47 +03:00
V. Elenhaupt
60c1b86890
Constantize string error messages (#50) 2018-04-17 07:29:43 +03:00
Vitalii Elenhaupt
d307f01bfa
Add a space delimiter to duplicated hash keys 2018-04-13 20:10:21 +03:00
Hugo Abonizio
21a3850a65 Ignore alternative names starting with _ 2018-04-12 19:20:41 +03:00
Hugo Abonizio
d6c6af883d Ignores PredicateName if alternative isn't valid (e.g. is_404?) 2018-04-12 19:20:41 +03:00
Vitalii Elenhaupt
9e2ab9c002
Show hash duplicated keys in error message
closes #45
2018-04-12 19:18:33 +03:00
Vitalii Elenhaupt
2f837375ec New rule: rand zero 2018-03-08 18:59:20 +02:00
Vitalii Elenhaupt
eda5960b0f Check for unneeded directives when all other rules are done 2018-02-02 22:17:04 +02:00
Vitalii Elenhaupt
6fb483a2dd Prevent disabling of UnneededDisableDirective rule 2018-02-02 22:17:04 +02:00
Vitalii Elenhaupt
8075c39aa9 Unneeded disable directive 2018-02-02 22:17:04 +02:00
Vitalii Elenhaupt
55b66e7975 Use more natural way to define error with custom loc 2018-01-30 16:09:00 +02:00
Vitalii Elenhaupt
4c85ad7c75 Syntax rule running priorities 2018-01-25 12:37:25 +02:00
Vitalii Elenhaupt
c9db63bf34 Syntax rule 2018-01-25 12:37:25 +02:00
Vitalii Elenhaupt
7e8703dda0 Crystal 0.24.1 support 2017-12-26 18:21:21 +02:00
Vitalii Elenhaupt
eca0d28692
Excluded relative path path 2017-12-18 13:06:19 +02:00
V. Elenhaupt
f12a224dad
New rule: shadowed exception (#25) 2017-12-06 16:59:10 +02:00
Vitalii Elenhaupt
96c1af4e35
New rule: useless condition in when
thanks to @hugoabonizio for suggesstion
2017-12-02 21:55:50 +02:00
Vitalii Elenhaupt
db815a2e30
Fix error message 2017-12-01 00:03:05 +02:00
Hugo Abonizio
b023ae0baa Disallows while true (#22)
* Disallows `while true`

* Add syntax highlighting in documentation

* Replace `while true` occurrencies

* Add WhileTrue rule to config sample
2017-11-27 15:35:15 +02:00
Vitalii Elenhaupt
21abce63bd
Report only wrong predicate names 2017-11-23 19:58:59 +02:00
Vitalii Elenhaupt
dceafd26e5
Except & only cli flags 2017-11-23 19:49:45 +02:00
Vitalii Elenhaupt
f4f401d56f
Make config loading more flexible 2017-11-23 10:41:22 +02:00
Vitalii Elenhaupt
0520774930
New rule: duplicated when 2017-11-18 18:39:45 +02:00
Vitalii Elenhaupt
1839ef2ab5
New rule: hash duplicated key 2017-11-18 00:51:16 +02:00
Vitalii Elenhaupt
791bfdabb8
New rule: percent arrays 2017-11-17 23:56:52 +02:00
Vitalii Elenhaupt
0f25b50a57
Add missing YAML sample 2017-11-17 19:34:01 +02:00
Vitalii Elenhaupt
3c9df13beb
New option: LargeNumbers#int_min_digits (default: 5) 2017-11-17 19:07:39 +02:00
Vitalii Elenhaupt
b3a9ff2fa0
Mark begin; end as empty expression 2017-11-17 18:32:40 +02:00
Vitalii Elenhaupt
fb398b5056
New rule: redundant begin 2017-11-17 18:15:11 +02:00
Vitalii Elenhaupt
e5081fa970
New rule: empty ensure 2017-11-16 16:31:32 +02:00
Vitalii Elenhaupt
57b1095c5f
Document entities 2017-11-15 23:37:16 +02:00
Vitalii Elenhaupt
06855816d7
Document configuration properties & specs 2017-11-14 10:28:26 +02:00
Vitalii Elenhaupt
822a69b81c
Base YAML config loader & Ameba runner 2017-11-14 09:00:15 +02:00
Vitalii Elenhaupt
80e2ab4f55
Ameba::Rule -> Ameba::Rule::Base 2017-11-08 00:02:32 +02:00
Vitalii Elenhaupt
9bba850a9b
Docs & tests 2017-10-30 22:00:01 +02:00
Vitalii Elenhaupt
5e10113055
It works 2017-10-27 00:07:43 +03:00
Vitalii Elenhaupt
4e84ac871a
New rule: Line Length 2017-10-26 21:47:35 +03:00