Commit graph

59 commits

Author SHA1 Message Date
Sijawusz Pur Rahnama
e99a69765f Few refactors 2024-01-01 14:46:32 +01:00
Sijawusz Pur Rahnama
6d0b12c70f Cleanup docs 2024-01-01 14:46:32 +01:00
Sijawusz Pur Rahnama
61ccb030bd Fix newly found offenses 2023-11-11 19:08:14 +01:00
Sijawusz Pur Rahnama
1b342e8257 Make TODOFormatter's configuration file path configurable
Fixes the case where formatter specs were deleting project's `.ameba.yml` file
2023-11-06 16:59:09 +01:00
Sijawusz Pur Rahnama
1b57e2cad5 Make Formatter::Util extend itself for easier access 2023-11-05 06:08:40 +01:00
Sijawusz Pur Rahnama
bede3f97a1 Colorize code in rule descriptions too 2023-11-04 00:49:11 +01:00
Sijawusz Pur Rahnama
1718945523 Refactor ExplainFormatter a bit 2023-11-04 00:49:11 +01:00
Sijawusz Pur Rahnama
749da0984c Rename Config::PATH to Config::DEFAULT_PATH 2023-03-06 20:54:35 +01:00
Sijawusz Pur Rahnama
4dd62a3ed1 Colorize also the code in single backticks 2022-11-28 11:49:26 +01:00
Sijawusz Pur Rahnama
33ef9c6293 Refactor ExplainFormatter 2022-11-28 11:38:41 +01:00
Sijawusz Pur Rahnama
f9b05a309e Redundant whitespace before nl 2022-11-28 11:25:21 +01:00
Sijawusz Pur Rahnama
0f893971dc Avoid one-letter names if possible 2022-11-28 11:25:21 +01:00
Sijawusz Pur Rahnama
d19d3b78c4 Implement Severity#color property 2022-11-28 06:07:19 +01:00
Sijawusz Pur Rahnama
735ec2462a Refactor usages of \ to sth more readable if possible 2022-11-23 05:50:32 +01:00
Sijawusz Pur Rahnama
e54029d8ed Few more readability refactors 2022-11-15 20:55:32 +01:00
Sijawusz Pur Rahnama
a6ebb48f14 Remove redundant parentheses in if expressions
+ `elsif` -> `case`
2022-11-14 01:52:07 +01:00
fn ⌃ ⌥
f288cc3c4f
Add Style/GuardClause rule (#254) 2021-12-09 21:33:47 +01:00
fn ⌃ ⌥
a40fdee33f Revert "Add autocorrect checks to ExplainFormatter"
This reverts commit 1b6fe40a3b.
2021-10-31 22:12:21 -07:00
fn ⌃ ⌥
1b6fe40a3b Add autocorrect checks to ExplainFormatter 2021-10-26 22:22:22 -07:00
fn ⌃ ⌥
8d3b76003e Add autocorrect checks to Flycheck, JSON, and TODO formatters 2021-10-26 22:22:22 -07:00
fn ⌃ ⌥
f39a7a4cd4 Re-run autocorrect until all correctable issues have been corrected 2021-10-25 15:09:44 -07:00
fn ⌃ ⌥
99e7ccd23b Add --autocorrect CLI option 2021-10-25 12:38:29 -07:00
Sijawusz Pur Rahnama
ea98554191
Add support for showing end location marker (#200)
* Add support for showing end location marker

* Cleanup Reportable method definitions

There’s no need for double splats, since they mess up method resolution, and obscure the actual - single (!) - argument - `status`, so… be gone

Also, all of the helpers return the constructed `Issue` like a behaving good methods.

* Refactor Util#affected_code

* Increase max length of trimmed lines to 120 characters

* Refactor Issue to use enum instead of a symbol for #status

* Optimize Reportable#valid?

* Add spec coverage for newly added Util methods

* Refactor DotFormatter a bit

Make text format moar in line with Crystal spec runner.

* Update README.md
2021-01-26 08:38:19 +02:00
Sijawusz Pur Rahnama
928a260d51 Remove extraneous blank lines 2021-01-17 18:45:14 +01:00
Sijawusz Pur Rahnama
af5d825015 Followup to #185 2021-01-17 18:45:14 +01:00
Sijawusz Pur Rahnama
06852c490b Followup to #185 2021-01-17 13:25:50 +01:00
Sijawusz Pur Rahnama
c4d34d74d8
Add support for showing code context lines (#181)
* Add support for showing code context lines

* Show context lines only in ExplainFormatter

* Add spec coverage for context_lines option
2021-01-12 17:20:43 +02: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
07e72b7bf9
Lint in parallel (#118)
* Lint in parallel

* Synced output for dot/flycheck formatters

* Re-raise exceptions raised in fibers

* Add readme instructions
2019-11-09 19:31:41 +02:00
Vitalii Elenhaupt
8d00d54012
Fix typos 2019-10-28 00:02:31 +02:00
Vitalii Elenhaupt
4ae0195628
Avoid duplicated sections in a generated TODO file (additional fix) 2019-10-27 22:56:53 +02:00
Vitalii Elenhaupt
2704a0d8b1
Do not generate todo file there are no issues 2019-10-27 17:49:30 +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
117e100855
Add severity to formatters 2019-04-14 16:45:31 +03:00
Vitalii Elenhaupt
3dabfb8dec
Correct json formatter output example 2019-02-24 20:04:04 +02:00
Sijawusz Pur Rahnama
e8a68a80d5 Fix several misspellings (#94) 2019-02-23 07:06:28 +02:00
Vitalii Elenhaupt
f294bb6a68
Improve explain output 2019-01-13 22:14:25 +02:00
Vitalii Elenhaupt
c91da1aa08
Let ameba explain the issue at the specified location (#86) 2018-12-27 23:34:10 +02:00
Vitalii Elenhaupt
1d96319506
Remove unneded argument 2018-12-15 22:16:40 +02:00
Vitalii Elenhaupt
f671d6f857
Show affected code while using a default formatter 2018-12-12 21:45:00 +02:00
Vitalii Elenhaupt
18ac04d992
Generate UTC time in todo 2018-09-06 18:48:36 +03:00
Vitalii Elenhaupt
f4680a75f4
Apply default formatting 2018-09-03 00:17:56 +03:00
V. Elenhaupt
4cb5328513
Add rule namespaces: style, lint, layout (#63) 2018-06-16 14:50:59 +03:00
Vitalii Elenhaupt
23245d0e52 Add end_location to json formatter 2018-06-12 12:55:56 +03:00
Vitalii Elenhaupt
f8d14d4222 Rename Error to Issue 2018-06-12 12:55:56 +03:00
Vitalii Elenhaupt
4546b90b54 Add JSON formatter 2018-05-11 21:28:30 +03:00
Vitalii Elenhaupt
2382657e15
Add rule's name to flycheck formatter 2018-01-31 13:30:59 +02:00
Vitalii Elenhaupt
69cff77970 Add DisabledFormatter to trace disabled lines 2018-01-30 16:09:00 +02:00
Vitalii Elenhaupt
9f85b16e09 Add inline directives parsing and disabling 2018-01-30 16:09:00 +02:00