Skip to content

Add linter for no spaces before function calls #204

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 5 commits into from
Mar 21, 2017

Conversation

jrnold
Copy link
Contributor

@jrnold jrnold commented Feb 12, 2017

Apologies if I missed a linter that was already defined; I looked but I couldn't find it (althoug

This adds a new linter, function_left_parentheses_linter, which checks that for function calls there is no space before the parentheses. This is almost the inverse of the spaces_left_parentheses_linter, which checks for spaces before parentheses except when it is a function.

This only considers function calls and not after , brackets instead of parentheses, or after curly brackets, square brackets, or parentheses. I didn't know if they belonged in this or another linter.

This linter handles cases like print (blah) which should be print(blah).

This linter checks that for function calls there is no space before the parentheses. This is almost the inverse of the  which checks for spaces before parentheses *except* when it is a function.

This only considers function calls and not after , brackets instead of parentheses, or after curly brackets, square brackets, or parentheses. I didn't know if they belonged in this or another linter.

This linter handles cases like  which should be .
@jrnold jrnold changed the title Add new linter for no-space before function calls Add new linter for no spaces before function calls Feb 12, 2017
Changes to xml2 meant that this testthat test was failing. Fix it to pass Travis.
@codecov-io
Copy link

codecov-io commented Feb 26, 2017

Codecov Report

Merging #204 into master will increase coverage by 0.8%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master     #204     +/-   ##
=========================================
+ Coverage   81.31%   82.11%   +0.8%     
=========================================
  Files          30       31      +1     
  Lines        1702     1728     +26     
=========================================
+ Hits         1384     1419     +35     
+ Misses        318      309      -9
Impacted Files Coverage Δ
R/function_left_parentheses.R 100% <100%> (ø)
R/tree-utils.R 98.5% <0%> (+13.43%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e16d6b...8e2ce18. Read the comment docs.

@jrnold jrnold changed the title Add new linter for no spaces before function calls Add linter for no spaces before function calls Feb 27, 2017
@jimhester
Copy link
Member

I think this looks good, could you add a note to NEWS.md?

@jrnold
Copy link
Contributor Author

jrnold commented Mar 7, 2017

I put the note under 1.0.0.9000, but should I have created a new section 1.0.0.9001?

@jimhester jimhester merged commit 8e2ce18 into r-lib:master Mar 21, 2017
@jimhester
Copy link
Member

Thanks!

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.

3 participants