Skip to content

Object name operator - #621

Merged
MichaelChirico merged 16 commits into
masterfrom
object-name-operator
Dec 1, 2020
Merged

MichaelChirico merged 16 commits into
masterfrom
object-name-operator

Conversation

@MichaelChirico

Copy link
Copy Markdown
Collaborator

Closes #615

Comment thread R/object_name_linters.R Resolved
@MichaelChirico

Copy link
Copy Markdown
Collaborator Author

Will add tests before merging

@AshesITR

AshesITR commented Nov 29, 2020 •

Copy link
Copy Markdown
Collaborator

Wouldn't it be simpler to add a new name style, operator_symbols that allows %[^[:alnum:]]+% and add that to the default (i.e. object_name_linter(style = c("snake_case", "operator_symbols"))?

This has the benefit of not hard-wiring the exception so they can be disabled if desired.

EDIT: On looking at the existing names, symbols, could be a better fit for the name of that style.
Current styles are:

  • CamelCase
  • camelCase
  • snake_case (default)
  • SNAKE_CASE
  • dotted.case
  • lowercase
  • UPPERCASE

@MichaelChirico

Copy link
Copy Markdown
Collaborator Author

great idea. much better.

Comment thread R/object_name_linters.R Resolved
AshesITR
AshesITR previously approved these changes Nov 29, 2020

@AshesITR AshesITR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks!

@MichaelChirico
MichaelChirico merged commit 3dcde70 into master Dec 1, 2020
@MichaelChirico
MichaelChirico deleted the object-name-operator branch December 1, 2020 14:38
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.

object_name_linter catches nonalphanumeric operator names

2 participants