Skip to content

fix symbols style #698

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

Merged
merged 2 commits into from
Dec 10, 2020
Merged

fix symbols style #698

merged 2 commits into from
Dec 10, 2020

Conversation

AshesITR
Copy link
Collaborator

@AshesITR AshesITR commented Dec 9, 2020

fixes #495

the major issue was that as.character() doesn't unescape XML entities. xml2::xml_text() should have been used instead.

fixes #495

the major issue was that `as.character()` doesn't unescape XML entities. `xml2::xml_text()` should have been used instead.
@@ -283,7 +284,7 @@ loweralnum <- rex(one_of(lower, digit))
upperalnum <- rex(one_of(upper, digit))

style_regexes <- list(
"symbols" = rex(start, maybe("."), zero_or_more(none_of(alnum)), end),
"symbols" = rex(start, zero_or_more(none_of(alnum)), end),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The empty name can occur here because symbols like <- are stripped before passing on to the regex.

Copy link
Collaborator

Choose a reason for hiding this comment

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

this feels somewhat hacky... but OK for now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The reason is the other styles should allow e.g. snake_case<- as a function name

Copy link
Collaborator

Choose a reason for hiding this comment

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

As long as applying those rules in the same order always works, we're OK, I'm just not 100% sure of that.

@AshesITR AshesITR merged commit 180e1a1 into master Dec 10, 2020
@AshesITR AshesITR deleted the fix/object_name-symbols branch December 10, 2020 07:05
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.

False-positive object_name_linter for %<-%
2 participants