Commit graph

44 commits

Author SHA1 Message Date
Sijawusz Pur Rahnama
a8fca61b22 Doc tweaks 2022-12-10 00:20:20 +01:00
Sijawusz Pur Rahnama
748cab29b4 Remove redundant empty comment lines 2022-11-28 11:38:41 +01:00
Sijawusz Pur Rahnama
629e65127d if … == nil -> unless … 2022-11-28 11:38:41 +01:00
Sijawusz Pur Rahnama
75482a06cf Use warning as a default severity for Metrics and Performance groups 2022-11-23 15:06:24 +01:00
Sijawusz Pur Rahnama
3b7cd3723c Refactor rules’ default group severity handling 2022-11-23 15:04:47 +01:00
Sijawusz Pur Rahnama
2af58cabd4 Use property? for defining Bool-returning Rule properties 2022-11-22 19:49:16 +01:00
Sijawusz Pur Rahnama
c7c75ee36a Rule#enabled -> Rule#enabled? 2022-11-22 19:47:37 +01:00
Sijawusz Pur Rahnama
e668ba5bf5 Readability-related refactors 2022-11-14 02:26:52 +01:00
fn ⌃ ⌥
f288cc3c4f
Add Style/GuardClause rule (#254) 2021-12-09 21:33:47 +01:00
fn ⌃ ⌥
749c53527e Add documentation 2021-10-26 22:22:22 -07:00
fn ⌃ ⌥
99e7ccd23b Add --autocorrect CLI option 2021-10-25 12:38:29 -07:00
Sijawusz Pur Rahnama
ad8f570a04 Change Rule to class 2021-01-19 22:17:17 +01:00
Sijawusz Pur Rahnama
6898aa8976
Fix issue #187 (#189)
* Avoid using `tap` with structs

* Remove extraneous blank lines

* Readability
2021-01-17 22:31:53 +02:00
Sijawusz Pur Rahnama
06852c490b Followup to #185 2021-01-17 13:25:50 +01:00
Sijawusz Pur Rahnama
19c370aee0
Misc refactors (#180)
* Optimize Severity#symbol

* Remove empty else branches

* Optimize map+compact/flatten calls

* Misc stylistic refactors
2021-01-11 20:13:58 +02:00
Vitalii Elenhaupt
c3260c1740
Move to YAML::Serializable 2020-06-15 14:29:49 +03:00
Vitalii Elenhaupt
9a6c4e52f4
Document Globs/Excluded 2020-03-22 15:08:04 +02:00
Vitalii Elenhaupt
2303bd82ae
Ability to excluded globally 2020-03-22 15:05:47 +02:00
Vitalii Elenhaupt
bffc46c545
Ability to configure globs 2020-03-22 15:05:47 +02:00
Vitalii Elenhaupt
ffa5dc9b4c
Crystal 0.29 fixes (#109)
* Fixes vs crystal head

* Use crystal nightly

* Remove trailing ? from local variable

* Do not use ? in the lhs

ref https://github.com/crystal-lang/crystal/issues/6685#issuecomment-419758587

* Upgrade to crystal 0.29.0 (warnings free) (#108)

* Remove trailing ? from local variable (take 2)

* Fix Time.now deprecation warnings

* Remove Crystal nightly
2019-06-06 19:10:26 +03:00
Vitalii Elenhaupt
de587f500a
Rename Severity::Refactoring -> Severity::Convention
it preserves clang format
2019-05-11 21:17:49 +03:00
Vitalii Elenhaupt
575fe07879
Change the level of failure in the runner 2019-04-14 15:57:48 +03:00
Vitalii Elenhaupt
f6a57f9272
Set default severities 2019-04-14 12:15:38 +03:00
Vitalii Elenhaupt
0be42f94db
Convertable severity 2019-04-13 21:16:59 +03:00
Vitalii Elenhaupt
3c5e3cdef4
Exclude globs as arguments
Examples:

  $ ameba path/to/shard/*.cr !path/to/shard/lib
  $ ameba . !lib
2019-01-13 10:48:46 +02:00
Vitalii Elenhaupt
f4680a75f4
Apply default formatting 2018-09-03 00:17:56 +03:00
Vitalii Elenhaupt
d60aea102f
Add --no-color cli flag
closes #72
2018-08-13 00:05:11 +03:00
V. Elenhaupt
fafc5f4bdc
Allow filtering by group name (#65) 2018-06-18 10:25:06 +03:00
Brian J. Cardiff
3e099e9afc Support upcoming Crystal 0.25.0
The changes are compatible with crystal 0.24.2
2018-05-23 13:29:27 +03:00
Vitalii Elenhaupt
4546b90b54 Add JSON formatter 2018-05-11 21:28:30 +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
Vitalii Elenhaupt
eda5960b0f Check for unneeded directives when all other rules are done 2018-02-02 22:17:04 +02:00
Vitalii Elenhaupt
69cff77970 Add DisabledFormatter to trace disabled lines 2018-01-30 16:09:00 +02:00
Vitalii Elenhaupt
1d436fbb94
Allow to configure formatter via configuration file
closes #20
2018-01-25 16:53:08 +02:00
Vitalii Elenhaupt
8bf5066d6a Add Excluded property to the rule 2017-12-01 19:01:25 +02:00
Vitalii Elenhaupt
a1854c0aa3 TODO formatter 2017-12-01 19:01:25 +02:00
Vitalii Elenhaupt
bc552d0730 Generate config
closes #17
2017-12-01 19:01:25 +02:00
Vitalii Elenhaupt
dceafd26e5
Except & only cli flags 2017-11-23 19:49:45 +02:00
Vitalii Elenhaupt
34707903b8
Fix nodoc 2017-11-23 10:54:56 +02:00
Vitalii Elenhaupt
f4f401d56f
Make config loading more flexible 2017-11-23 10:41:22 +02:00
Vitalii Elenhaupt
b5c9f4dff6
Fix mistakes/typos 2017-11-19 13:31:20 +02:00
Vitalii Elenhaupt
57b1095c5f
Document entities 2017-11-15 23:37:16 +02:00
Vitalii Elenhaupt
8f4def5407
Load default config if no cli args specified 2017-11-14 11:48:06 +02:00
Vitalii Elenhaupt
822a69b81c
Base YAML config loader & Ameba runner 2017-11-14 09:00:15 +02:00