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: code quality issues #3259

Merged
merged 6 commits into from Mar 8, 2021
Merged

Fix: code quality issues #3259

merged 6 commits into from Mar 8, 2021

Conversation

withshubh
Copy link
Contributor

Description

This PR fixes a few issues that were affecting the code quality.

Summary of changes

  • Prefer rescuing StandardError over Exception
  • Replace and/or with &&/||
  • Fixes ambiguous operators in method arguments
  • Remove ambiguous regular expression literals in method invocations
  • Remove redundant and unnecessary require statement

@withshubh withshubh marked this pull request as draft February 18, 2021 17:48
Signed-off-by: shubhendra <withshubh@gmail.com>
Signed-off-by: shubhendra <withshubh@gmail.com>
Signed-off-by: shubhendra <withshubh@gmail.com>
Signed-off-by: shubhendra <withshubh@gmail.com>
Signed-off-by: shubhendra <withshubh@gmail.com>
@ashie
Copy link
Member

ashie commented Mar 2, 2021

  • Prefer rescuing StandardError over Exception

I think it should be a separated PR because it may change the behavior.

@withshubh withshubh marked this pull request as ready for review March 3, 2021 10:01
@withshubh
Copy link
Contributor Author

  • Prefer rescuing StandardError over Exception

I think it should be a separated PR because it may change the behavior.

Shall I revert this fix and submit a new PR for the same?

@ashie
Copy link
Member

ashie commented Mar 4, 2021

  • Prefer rescuing StandardError over Exception

I think it should be a separated PR because it may change the behavior.

Shall I revert this fix and submit a new PR for the same?

Please remove this commit and force push.
I'll never accept this change because it may break availability.
For example it can't rescue SyntaxError.

Signed-off-by: shubhendra <withshubh@gmail.com>
@withshubh
Copy link
Contributor Author

  • Prefer rescuing StandardError over Exception

I think it should be a separated PR because it may change the behavior.

Shall I revert this fix and submit a new PR for the same?

Please remove this commit and force push.
I'll never accept this change because it may break availability.
For example it can't rescue SyntaxError.

Reverted ✨ @ashie

@ashie
Copy link
Member

ashie commented Mar 8, 2021

Thanks! Other changes seem reasonable, I'll merge it.

@ashie ashie merged commit 4cd2be4 into fluent:master Mar 8, 2021
@withshubh
Copy link
Contributor Author

Hi @ashie 👋
I ran DeepSource analysis on my fork of this repository to detect these issues. Have a look at the issues caught in this repository by DeepSource here.

DeepSource is a code review automation tool that detects code quality issues and helps you to automatically fix some of them. You can use DeepSource to track test coverage, Detect problems in Dockerfiles, etc. in addition to detecting issues in code.

Can I submit a new PR with the configuration file which I used to configure the analysis?
You can merge the configuration file to continuously analyze the repo and fix code quality issues.

@ashie
Copy link
Member

ashie commented Mar 8, 2021

Interesting. PR is welcome 😄

@withshubh withshubh mentioned this pull request Mar 8, 2021
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.

None yet

3 participants