Split detekt custom rules to handle code point limit#2863
Conversation
f26f5d8 to
6c5b4bb
Compare
6c5b4bb to
bf9b009
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2863 +/- ##
===========================================
- Coverage 70.91% 70.74% -0.17%
===========================================
Files 809 809
Lines 29460 29460
Branches 4937 4937
===========================================
- Hits 20889 20839 -50
- Misses 7236 7261 +25
- Partials 1335 1360 +25 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
are you sure that by splitting the rule into 2 different files it gets executed as a single rule, just once and not twice, like rules with different configs?
There was a problem hiding this comment.
I was able to find this quote about how detekt handles multiple configs: "Currently Detekt supports specifying multiple config files, which will be merged together at runtime with priority in reverse of the order they are specified. If a later file defines a given rule, that definition will supersede any previous definitions of that rule."
What does this PR do?
We are currently receiving errors of
The incoming YAML document exceeds the limit: 102400 code pointswhen running custom rules, as soon as the detekt_custom.yml exceeds a certain number of code points. This error is actually not originating in detekt, but rather in snakeYAML that is a detekt dependency. While we might be able to override the limit by using a custom YAML parser, this is complicated by our also running detekt through a shell script. Therefore I'm using a simpler alternative here that will work for both methods that we use for running the rules - splitting the yml file.In this PR I split the detekt_custom.yml into three separate parts:
and these parts are then concatenated together when detekt is run.
Motivation
Work around the code point limit.
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)