-
Notifications
You must be signed in to change notification settings - Fork 473
Issue #11866: Upgrade detekt and its configuration to 1.19.0 #11867
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Keen to see this land sooner in the release cycle and slowly start to enable more checks over time.
@@ -186,24 +282,44 @@ naming: | |||
minimumFunctionNameLength: 3 | |||
FunctionNaming: | |||
active: true | |||
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$' | |||
functionPattern: '([a-z][a-zA-Z0-9]*)|(`.*`)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider updating to include support for Compose (i.e. allow capitals for the first character): https://detekt.dev/compose.html#configurations
functionPattern: '([a-z][a-zA-Z0-9]*)|(`.*`)' | |
functionPattern: '[A-Za-z][a-zA-Z0-9]*)|(`.*`)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we good here because we have ignoreAnnotated: ['Composable']
, which is one of the options provided that I think it's preferable to modifying functionPattern
since someone else might just look at this without context (unless we added a comment) and realign it with the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs say that ignoreAnnotated
is for the annotation @Composable
. Whereas the functionPattern
is so that the functions that start with a capital won't be mark as a lint error.
UseCheckNotNull: | ||
active: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider as nice-to-have, but requires you to re-run baseline.
UseCheckNotNull: | |
active: false | |
UseCheckNotNull: | |
active: true |
UseOrEmpty: | ||
active: false | ||
UseRequire: | ||
active: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh, I like, but maybe we can enable this in the future - we throw lots of illegal states.
active: false | |
active: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will keep all of these in the follow up. I didn't want to run another lint-baselint if we can just fix up the issues.
active: false | ||
UseOrEmpty: | ||
active: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More nice-to-have.
active: false | |
active: true |
Fixes #11866. Original PR can be found at #11540. I went through everything line by line comparing our original base config that was from 1.0.0RC6-4 https://github.com/detekt/detekt/blob/RC6-4/detekt-cli/src/main/resources/default-detekt-config.yml to the latest https://github.com/detekt/detekt/blob/v1.19.0/detekt-core/src/main/resources/default-detekt-config.yml trying to align and keep the config as close to the defaults except where we have made known changes to enable a rule. There have been some new rules that were turned on by default over the several versions - I tried to align with them where possible assuming that it did not add to the baseline. Otherwise, I kept the rule off based on the 1.0.0RC6-4 default.
Pull Request checklist
After merge