Commit graph

103 commits

Author SHA1 Message Date
Sijawusz Pur Rahnama
b25dc402c8 Group naming-related rules 2023-11-09 00:16:29 +01:00
Sijawusz Pur Rahnama
4d0125a0f3 Fix Style/VerboseBlock rule to work with binary operations 2023-06-29 08:15:39 +02:00
Sijawusz Pur Rahnama
16141a376e Cleanup properties definition macro 2023-06-14 15:08:19 +02:00
Sijawusz Pur Rahnama
596b0dd9d0 Misc tweaks and refactors 2023-06-14 15:06:24 +02:00
Sijawusz Pur Rahnama
38b6751bc0 Add AST::NodeVisitor::Category simplifying code a bit 2023-06-12 23:17:14 +02:00
Vitalii Elenhaupt
c9c5fb655f
fix(style): correct typo in rule doc 2023-02-19 13:47:17 +02:00
Sijawusz Pur Rahnama
caaf803ecd Tweak reported location for Style/UnlessElse 2022-12-23 14:46:45 +01:00
Sijawusz Pur Rahnama
2d9e328d97
Merge pull request #325 from FnControlOption/unless_else
Add autocorrect for `Style/UnlessElse`
2022-12-22 21:43:49 +01:00
Sijawusz Pur Rahnama
2cedd72b09 Apply review sugggestions 2022-12-22 19:18:27 +01:00
Sijawusz Pur Rahnama
4e3caf2986 Few tweaks and readability refactors 2022-12-20 03:26:13 +01:00
fn ⌃ ⌥
d7795c0d7d Add autocorrect for Style/UnlessElse 2022-12-19 06:40:28 -08:00
Sijawusz Pur Rahnama
b6f3d41211 Small refactor 2022-12-15 18:35:16 +01:00
Sijawusz Pur Rahnama
07ce595ef2 Readability refactors 2022-12-08 17:47:22 +01:00
Sijawusz Pur Rahnama
784e3ac616 Use bang variants in couple of places more 2022-12-08 13:59:42 +01:00
Sijawusz Pur Rahnama
7d88455b7f Add corrector to the Style/IsANil rule 2022-12-08 13:58:35 +01:00
Sijawusz Pur Rahnama
cdf0405496 Refactor Style/IsANil rule to use newly added path_named? helper 2022-12-08 02:16:16 +01:00
Sijawusz Pur Rahnama
1524aad299 Add Style/QueryBoolMethods rule 2022-12-08 02:16:16 +01:00
Sijawusz Pur Rahnama
a8f953a2b2 Compress identical method definitions 2022-11-28 11:38:41 +01:00
Sijawusz Pur Rahnama
b79f3e6e07 Minor refactors in Style/LargeNumbers rule 2022-11-28 11:38:41 +01:00
Sijawusz Pur Rahnama
134963ece7 Minor details 2022-11-28 11:38:41 +01:00
Sijawusz Pur Rahnama
0f893971dc Avoid one-letter names if possible 2022-11-28 11:25:21 +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
5ee4074c1b Rename RedundantParentheses -> ParenthesesAroundCondition
Also rename the option: `parenthesized_assignments` -> `allow_safe_assignment`
2022-11-18 21:06:51 +01:00
Sijawusz Pur Rahnama
eabe463386 Instead of adding the new rule to support enforcing parens around assignments, refactor existing RedundantParentheses rule 2022-11-18 05:27:05 +01:00
Sijawusz Pur Rahnama
94a271b2a1 Add Style/ParenthesizedAssignments rule 2022-11-17 21:32:47 +01:00
Sijawusz Pur Rahnama
95d68114c7 Fix typos throughout the code 2022-11-16 16:55:32 +01:00
Sijawusz Pur Rahnama
f9b6b17657
Merge pull request #305 from crystal-ameba/Sija/followup-to-pr-300
Few more readability refactors
2022-11-16 16:26:59 +01:00
Sijawusz Pur Rahnama
935296b041 Refactor ternary handling in Style/RedundantParentheses rule 2022-11-16 03:54:31 +01:00
Sijawusz Pur Rahnama
e54029d8ed Few more readability refactors 2022-11-15 20:55:32 +01:00
Sijawusz Pur Rahnama
cbf5d3de74 Add Style/RedundantParentheses rule 2022-11-15 15:17:32 +01:00
Sijawusz Pur Rahnama
04b19a60db
Merge pull request #300 from crystal-ameba/Sija/some-refactors
Misc refactors
2022-11-14 17:27:29 +01:00
Sijawusz Pur Rahnama
e668ba5bf5 Readability-related refactors 2022-11-14 02:26:52 +01:00
Sijawusz Pur Rahnama
a6ebb48f14 Remove redundant parentheses in if expressions
+ `elsif` -> `case`
2022-11-14 01:52:07 +01:00
Sijawusz Pur Rahnama
d1bfdaabeb Use #in? instead of #includes? in several places
Because:

1. it’s more semantically descriptive
2. it’s shorter
2022-11-14 01:18:43 +01:00
Sijawusz Pur Rahnama
ed6085e6a6 Several refactors in Style/GuardClause rule
Mostly readability related
2022-11-14 01:18:43 +01:00
Sijawusz Pur Rahnama
5db7a2cf5a Turn on Style/PredicateName rule by default 2022-11-13 20:12:39 +01:00
Sijawusz Pur Rahnama
52bf0a5be4 Refactor Style/PredicateName rule
Do not report `has_<name>?` method names
2022-11-13 20:12:23 +01:00
Sijawusz Pur Rahnama
d942524efa Remove trailing dots from rule descriptions 2022-10-30 21:53:09 +01:00
Sijawusz Pur Rahnama
a9ae491aca
Merge pull request #280 from crystal-ameba/Sija-verbose-block-configuration-example-typo 2022-10-29 11:59:06 +02:00
Sijawusz Pur Rahnama
ffc712a838 Reduce usage of Object#not_nil! 2022-10-29 00:03:39 +02:00
Sijawusz Pur Rahnama
4063290530
Fix typo in a Style/VerboseBlock configuration example 2022-10-28 23:48:47 +02:00
Vitalii Elenhaupt
60bf8e13ce
fix(style): properly tokenize in RedundantBegin rule 2022-10-14 21:09:30 +03:00
Vitalii Elenhaupt
d2fbf484f4
Crystal 1.6 support 2022-10-14 20:55:29 +03:00
Vitalii Elenhaupt
8d4730182f
Rework breaking specs, break backward compatibility 2022-04-04 00:59:21 +03:00
Vitalii Elenhaupt
2f29999106
Return boolean 2022-04-03 19:43:51 +03:00
Vitalii Elenhaupt
087f470f15
Backward compatibility to Crystal 1.3 2022-04-03 19:17:47 +03:00
Vitalii Elenhaupt
7192b64df0
Fix rest of the specs 2022-03-11 18:00:25 +02:00
Vitalii Elenhaupt
03adc20872
Pass on crystal-nightly 2022-03-11 14:15:05 +02:00
Sijawusz Pur Rahnama
dad72341cb
Merge pull request #258 from crystal-ameba/bump-large-numbers-min-int-digits
Bump default value of `LargeNumbers#int_min_digits` to 6
2022-03-08 14:48:45 +01:00
Sijawusz Pur Rahnama
1795bd2959 Bump default value of LargeNumbers#int_min_digits to 6
As most of the error codes are smaller than 6 digits
2022-03-08 14:42:32 +01:00