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

Fix Codacy Warnings - Ensure Composable Function Names Start with a Capital Letter #4256

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

sowjanyakch
Copy link
Contributor

@sowjanyakch sowjanyakch commented Sep 20, 2024

Resolve #4014

solve codacy lint warning for composables.

The static code analysis gives a warning when composable functions name start with a capital letter. The functionPattern should be modified to write a composable function name with a capital letter.

🚧 TODO

  • ...

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

@sowjanyakch sowjanyakch force-pushed the solve_static_code_warnings branch from 07037a1 to 66153b6 Compare September 23, 2024 09:10
@sowjanyakch sowjanyakch changed the title solve codacy warnings for composable functions Fix Codacy Warnings - Ensure Composable Function Names Start with a Capital Letter Sep 23, 2024
@sowjanyakch sowjanyakch force-pushed the solve_static_code_warnings branch from 66153b6 to 03e477b Compare September 23, 2024 09:23
@sowjanyakch sowjanyakch self-assigned this Sep 23, 2024
@sowjanyakch sowjanyakch added the 3. to review Waiting for reviews label Sep 23, 2024
detekt.yml Outdated
@@ -278,7 +278,7 @@ naming:
minimumFunctionNameLength: 3
FunctionNaming:
active: true
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
functionPattern: '^([a-z$A-Z][a-zA-Z$0-9]*)|(.*)$'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see for the last part at the files app, it is still using the ` quotes around (.*)
Whats the difference?

https://github.com/nextcloud/android/blob/e3d57e7c42efa5dd4b52aeea71ee1dbbd903fe19/app/detekt.yml#L204

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By using quotes around (.*), we can use function names enclosed in backticks. This is a common notation in unit test cases. I will include the backticks.

@sowjanyakch sowjanyakch force-pushed the solve_static_code_warnings branch from 03e477b to 78a55c0 Compare September 24, 2024 11:43
Copy link
Contributor

Codacy

Lint

TypemasterPR
Warnings8696
Errors131131

SpotBugs

CategoryBaseNew
Bad practice66
Correctness1111
Dodgy code7979
Internationalization33
Malicious code vulnerability33
Performance66
Security11
Total109109

Lint increased!

Copy link
Contributor

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/4256-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

@mahibi mahibi merged commit 3d9d694 into master Sep 24, 2024
16 of 18 checks passed
@mahibi mahibi deleted the solve_static_code_warnings branch September 24, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix codacy static code analysis warnings for composables
2 participants