Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Fix detekt warnings 2810 #2813

Merged

Conversation

priyatanu
Copy link
Contributor

@priyatanu priyatanu commented Nov 2, 2023

Pull Request (PR) Checklist

Please check if your pull request fulfills the following requirements:

  • The PR is submitted to the main branch.
  • I've read the Contribution Guidelines and my PR doesn't break the "Contributing Rules".
  • I've read the Architecture Guidelines.
  • I confirm that I've run the code locally and everything works as expected.
  • 🎬 I've attached a screen recoding of the changes.

Tip: drag & drop the video to the PR description.

What's changed?

Describe with a few bullets what's new:

  • a
  • b
  • c
  • d

💡 Tip: Please, attach screenshots and screen recordings. It helps a lot!

Risk Factors

What may go wrong if we merge your PR?

  • a
  • b
  • c

In what cases your code won't work?

  • a
  • b
  • c

Does this PR closes any GitHub Issues?

Check Ivy Wallet Issues.

  • Closes #ISSUE_NUMBER

Replace ISSUE_NUMBER with your issue number (for example Closes #1234). If you've done that correctly, you'll see the issue title linked when previewing your PR description.

Troubleshooting CI failures

If you see any of the PR checks failing (❌) go to Actions and find it there. Or simply click "Details" next to the failed check and explore the logs to see why it has failed.

Detekt

Detekt is a static code analyzer for Kotlin that we use to enforce code readibility and good practices.

To run Detekt locally:

./gradlew detekt

If the Detekt errors are caused by a legacy code, you can suppress them using a basline.

Detekt baseline (not recommended)

./scripts/detektBaseline.sh

Lint

We use the standard Android Lint plus Slack's compose-lints as an addition to enforce proper Compose usage.

To run Lint locally:

./scripts/lint.sh

If the Lint errors are caused by a legacy code, you can suppress them using a basline.

Lint baseline (not recommended)

./scripts/lintBaseline.sh

Unit tests

If this job is failing this means that your changes break an existing unit test. You must identify the failing tests and fix your code.

To run the Unit tests locally:

./gradlew testDebugUnitTest

@priyatanu priyatanu force-pushed the priyatanudey/fix-issues-2810 branch from b25a8ea to f0452f3 Compare November 2, 2023 17:54
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Iliyan Germanov <[email protected]>
@priyatanu priyatanu force-pushed the priyatanudey/fix-issues-2810 branch from f0452f3 to 7a61150 Compare November 2, 2023 18:08
@priyatanu priyatanu changed the title Fix detekt warnings Fix detekt warnings 2810 Nov 2, 2023
Copy link
Collaborator

@ILIYANGERMANOV ILIYANGERMANOV left a comment

Choose a reason for hiding this comment

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

Clickable and then padding, so the click area can be enlarged by the padding

.background(backgroundColor, CircleShape)
.padding(clickAreaPadding), // enlarge click area
.padding(clickAreaPadding)
.clickable(onClick = onClick), // enlarge click area
Copy link
Collaborator

Choose a reason for hiding this comment

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

Clickable must come before padding; Otherwise the padding won't enlarge the click area

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you. I thought clickable area will include padding as well :(
Added previews as well

@priyatanu priyatanu force-pushed the priyatanudey/fix-issues-2810 branch from d151b44 to 38674ae Compare November 3, 2023 18:00
@priyatanu priyatanu force-pushed the priyatanudey/fix-issues-2810 branch from 38674ae to 4f2c2a8 Compare November 3, 2023 18:06
@ILIYANGERMANOV ILIYANGERMANOV merged commit 74c9994 into Ivy-Apps:main Nov 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example issue
2 participants