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

Object name operator #621

Merged
merged 16 commits into from
Dec 1, 2020
Merged

Object name operator #621

merged 16 commits into from
Dec 1, 2020

Conversation

MichaelChirico
Copy link
Collaborator

Closes #615

@MichaelChirico
Copy link
Collaborator Author

Will add tests before merging

@AshesITR
Copy link
Collaborator

AshesITR commented Nov 29, 2020

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
Collaborator Author

great idea. much better.

R/object_name_linters.R Show resolved Hide resolved
tests/testthat/test-object_name_linter.R Show resolved Hide resolved
AshesITR
AshesITR previously approved these changes Nov 29, 2020
Copy link
Collaborator

@AshesITR AshesITR left a comment

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