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

New else_same_line_linter #1002

Merged
merged 4 commits into from
Mar 28, 2022
Merged

New else_same_line_linter #1002

merged 4 commits into from
Mar 28, 2022

Conversation

MichaelChirico
Copy link
Collaborator

Part of #962

This one is also a candidate for default_linters

@AshesITR
Copy link
Collaborator

Do we already have a linter that ensures the opening braces are ob the same line?

Name suggestion: else_braces_linter?

@MichaelChirico
Copy link
Collaborator Author

I was thinking maybe we want to combine this with if_else_match_braces_linter into just an if_else_linter that identifies any style issues with if/else clauses, WDYT?

@AshesITR
Copy link
Collaborator

Both of these lint based on braces. What about if_else_braces_linter?
Or just braces_linter subsuming braces_left_parenthesis_linter as well and also (if not already present) checking { appears exactly one space after and on the same line as function() {, while (cond) {, for () {, repeat { etc.

@MichaelChirico
Copy link
Collaborator Author

braces_linter sounds great. Agree it's good to have a one-stop shop for enforcing all of the style guide rules around bracing.

IINM it'll require some more deprecation though, right? If so, maybe the right approach is

  1. Merge this as is
  2. File a follow-up to merge the linters
  3. Merge the linters
  4. Mark any merged linters appearing in previous releases as deprecated

WDYT?

@AshesITR
Copy link
Collaborator

SGTM. Maybe make the new one configurable to allow C style bracing etc.
deprecation could then be made to return a properly configured braces_linter() maybe.

Approving. Will you open a follow-up issue? Thanks!

AshesITR
AshesITR previously approved these changes Mar 28, 2022
# Conflicts:
#	man/linters.Rd
# Conflicts:
#	man/linters.Rd
@AshesITR AshesITR merged commit 5aa88f9 into master Mar 28, 2022
@AshesITR AshesITR deleted the else_same_line branch March 28, 2022 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants