Commit graph

10 commits

Author SHA1 Message Date
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
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
4c85ad7c75 Syntax rule running priorities 2018-01-25 12:37:25 +02:00
Vitalii Elenhaupt
eca0d28692
Excluded relative path path 2017-12-18 13:06:19 +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
57b1095c5f
Document entities 2017-11-15 23:37:16 +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
Renamed from src/ameba/rule.cr (Browse further)