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

feat: Add RSpec/ContextMethod rule only as warning #29

Merged
merged 1 commit into from
May 16, 2024

Conversation

DaniPB
Copy link
Contributor

@DaniPB DaniPB commented May 10, 2024

What is the goal?

Improve clarity, readability, consistency, and avoid ambiguity in our RSpec tests by adding the RSpec/ContextMethod rule.

🤓 Using describe and context methods explicitly communicates the code's intention more clearly, making it easier for other developers to understand the structure of the tests.

Screenshot 2024-05-10 at 17 06 36

Currently, we have 186 offenses to this rule.

Is this a restricting or expanding change?

RESTRICTING change

References

How is it being implemented?

I just added the rule to default.yml

Opportunistic refactorings

No

Caveats

I'll fix the 186 offenses in PRs like this one https://github.com/sequra/simba/pull/8245 after this rule is approved 🤞🏽 💕

@DaniPB DaniPB changed the title Add RSpec/ContextMethod rule only as warning feat: Add RSpec/ContextMethod rule only as warning May 13, 2024
@DaniPB DaniPB self-assigned this May 15, 2024
@DaniPB DaniPB marked this pull request as ready for review May 15, 2024 14:11
@DaniPB DaniPB requested a review from a team as a code owner May 15, 2024 14:11
Copy link

@mdeniz mdeniz left a comment

Choose a reason for hiding this comment

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

LGTM 🌮

@valdis
Copy link

valdis commented May 16, 2024

I find that warnings are often ignored. If a rule does not throw a failure in the CI pipeline, we'll have a lot of cases where developers don't notice this.
So the suggestion would be to make it as a propoer error.
The CI pipeline only checks changed files, so you don't have to worry that you'll get all the errors in the next PR

@gorka-sq
Copy link
Contributor

I find that warnings are often ignored. If a rule does not throw a failure in the CI pipeline, we'll have a lot of cases where developers don't notice this.

@valdis Agreed. We have a card in our backlog to review this flow 👍

@DaniPB
Copy link
Contributor Author

DaniPB commented May 16, 2024

@valdis Thank you for pointing this out. @gorka-sq, Do you think we should keep it as info or do we make the CI pipeline fail?

Also, I'd be fixing most of the offenses I don't think it should be a problem to remove the info, I just added it to follow our guidelines 😊

@gorka-sq
Copy link
Contributor

@DaniPB some of our projects run rubocop in full-mode, that's why we decided to take this informational mid-step. For now we are keeping it, but we will review this process soon(-ish) to remove the bureaucracy it introduces.

@gorka-sq gorka-sq merged commit 9ae2e5b into master May 16, 2024
8 of 10 checks passed
@gorka-sq gorka-sq deleted the add-rule-rspec-context-method branch May 16, 2024 08:29
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.

5 participants