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

Update detekt.yml to fix the large class lint issue #185

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

KesharwaniArpita
Copy link
Contributor

Contributor checklist


Description

This PR fixes linting issues due to Large Class Block by removing the line of code:

EmptyCatchBlock:
        active: true

Related issue

Copy link

github-actions bot commented Oct 10, 2024

Thank you for the pull request!

The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Android rooms once you're in. Also consider joining our bi-weekly Saturday dev syncs. It'd be great to have you!

Maintainer checklist

  • The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution

    • The contributor's name and icon in remote commits should be the same as what appears in the PR
    • If there's a mismatch, the contributor needs to make sure that the email they use for GitHub matches what they have for git config user.email in their local Scribe-Android repo
  • The linting and formatting workflows within the PR checks do not indicate new errors in the files changed

  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

@andrewtavis andrewtavis added the hacktoberfest-accepted Accepted as a part of Hacktoberfest label Oct 10, 2024
@andrewtavis
Copy link
Member

As with the other one, @KesharwaniArpita, it's not just to remove the line, but also to fix the issues that are being hidden by it. Looks like this one is just one issue, but then splitting MyKeyboardView is likely going to be really difficult 🤔

@KesharwaniArpita
Copy link
Contributor Author

Surely @andrewtavis , I'll do better

@andrewtavis
Copy link
Member

You're doing great, @KesharwaniArpita :)

@angrezichatterbox
Copy link
Member

As with the other one, @KesharwaniArpita, it's not just to remove the line, but also to fix the issues that are being hidden by it. Looks like this one is just one issue, but then splitting MyKeyboardView is likely going to be difficult 🤔

Yes, you're right @andrewtavis. It would not be easy to split the class and would require a major refactoring which might include several changes to the overall codebase.

@andrewtavis
Copy link
Member

Is there a way for us to put an ignore comment to turn detekt off for this file such that the tests pass, and then from there we'll have this fail if another class gets to be too large? We can then pick this up again at some point for a more full refactor? It looks like this discussion here might have some ways of doing this, i.e. adding something like excludes: ['/Scribe-Android/app/src/main/java/be/scri/views/MyKeyboardView.kt']?

@KesharwaniArpita
Copy link
Contributor Author

Is there a way for us to put an ignore comment to turn detekt off for this file such that the tests pass, and then from there we'll have this fail if another class gets to be too large? We can then pick this up again at some point for a more full refactor? It looks like this discussion here might have some ways of doing this, i.e. adding something like excludes: ['/Scribe-Android/app/src/main/java/be/scri/views/MyKeyboardView.kt']?

You mean by that instead of going straight to this file, we first focus on refactoring other files first and then move back to it later? Like a bottom to top approach?

@andrewtavis
Copy link
Member

This is the only class that has this problem, so if we ignore it or its file and just have that class in the file, then we'll be fine with this for now :)

@angrezichatterbox
Copy link
Member

Is there a way for us to put an ignore comment to turn detekt off for this file such that the tests pass, and then from there we'll have this fail if another class gets to be too large? We can then pick this up again at some point for a more full refactor? It looks like this discussion here might have some ways of doing this, i.e. adding something like excludes: ['/Scribe-Android/app/src/main/java/be/scri/views/MyKeyboardView.kt']?

@Suppress("LargeClass")

We can add this to the top of the class.

@andrewtavis
Copy link
Member

Do you want to make the change here, @KesharwaniArpita? When the tests pass we can then close this :)

@KesharwaniArpita
Copy link
Contributor Author

@andrewtavis Can I take it as a to do issue instead a WIP? I want to give it a try.

@andrewtavis
Copy link
Member

Feel free to commit the change to this PR, @KesharwaniArpita :) It's basically adding @Suppress("LargeClass") right above this class right here and then we'll be done here 😊

@KesharwaniArpita
Copy link
Contributor Author

Sure!! Thanks @andrewtavis and @angrezichatterbox

Copy link
Member

@andrewtavis andrewtavis left a comment

Choose a reason for hiding this comment

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

Fantastic, @KesharwaniArpita, and thanks for the great suggestion, @angrezichatterbox! 😊

@andrewtavis andrewtavis merged commit 3889184 into scribe-org:main Oct 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Accepted as a part of Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants