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 Layout/AccessModifierIndentation #22

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ Style/NestedModifier:
Style/SoleNestedConditional:
Enabled: true

# https://docs.rubocop.org/rubocop/cops_layout.html#layoutaccessmodifierindentation
Layout/AccessModifierIndentation:
EnforcedStyle: outdent
Severity: info

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a great opportunity to test out the drafted flow, thanks! 🙌🏻

The proposal is to add Severity: info to restricting changes, allowing some time for teams to adopt new restricting agreements on our style. Some months later, we can remove the Severity: info thingy to make the change mandatory.

We need to settle things and communicate changes to the teams before moving forward with the PR, but it would be great to have your early feedback on the proposal ❤️

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! Updated :)

Copy link

@valdis valdis Mar 22, 2024

Choose a reason for hiding this comment

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

i don't think that we need to make this severity: info, because rubocop checks are performed only on the changed files, so the impact is scoped to the code that you are workin on.
I think we all have allready agreed that we want uniform styling of the code everywhere, so adding yet another rule that slightly changes some of the code's formatting has minimal impact on our workflow.

Copy link
Contributor

Choose a reason for hiding this comment

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

@valdis not all applications have rubocop configured to run on changed files only, though that is the case for most of them. We want to make sure these style changes are as non-disruptive as possible to everyone, and that's why we proposed to use severity: info for restricting changes, making them mandatory only after teams have had enough time to update.

Maybe we should consider using non-full scans in all our repositories, though.

# Align `when` with `case`.
Layout/CaseIndentation:
Enabled: true
Expand Down