Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated detekt configuration to support compose: #4178

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jackq97
Copy link

@jackq97 jackq97 commented Jan 18, 2025

Linked issue #4159

  1. Increased the functionThreshold for LongParameterList from 6 to 8.
  2. Enabled ignoreDefaultParameters for LongParameterList.
  3. Updated functionPattern to allow uppercase letters at the beginning.
  4. Add ignoreAnnotatedFunctions to ['Preview']
  5. Add ignoreAnnotated to ['Composable']
  6. Updated constantPattern to accept uppercase letters followed by alphanumeric characters.
  7. Enabled ignorePropertyDeclaration for MagicNumber.

followed resource https://detekt.dev/docs/introduction/compose/
to edit the properties to support composable functions in detekt config.

Copy link
Collaborator

@MohitMaliFtechiz MohitMaliFtechiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackq97 There is some compilation error when I am running the detekt.

./gradlew ktlintCheck detektDebug detektCustomExampleDebug app:lintDebug custom:lintCustomexampleDebug --daemon

config/detekt/detekt.yml Outdated Show resolved Hide resolved
config/detekt/detekt.yml Outdated Show resolved Hide resolved
*   Increased the `functionThreshold` for `LongParameterList` from 6 to 8.
*   Enabled `ignoreDefaultParameters` for `LongParameterList`.
*   Updated `functionPattern` to allow uppercase letters at the beginning.
* Add  `ignoreAnnotatedFunctions` to `['Preview']`
* Add `ignoreAnnotated` to `['Composable']`
* Updated `constantPattern` to accept uppercase letters followed by alphanumeric characters.
* Enabled `ignorePropertyDeclaration` for `MagicNumber`.
- Removed 'Preview' from `ignoreAnnotatedFunctions` in Complexity rule set.
'not supported in this version'
- Updated `constantPattern` to `[A-Z][_A-Z0-9]*` for TopLevelPropertyNaming rule.
- Added 'Preview' to `ignoreAnnotated` in UnusedPrivateMember rule set.
@jackq97
Copy link
Author

jackq97 commented Jan 22, 2025

@MohitMaliFtechiz Pushed the updated file, please check it. all checks are passed in detektDebug.

Copy link
Collaborator

@MohitMaliFtechiz MohitMaliFtechiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackq97 Thanks for the changes. @kelson42 LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants