- 
                Notifications
    You must be signed in to change notification settings 
- Fork 195
add function_argument_linter() #1420
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
Conversation
ee82388    to
    6316738      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind running this on all (a bunch of?) the tidyverse/r-lib packages? I have a feeling we may be missing some common case, or that it's violated a lot in practice. Any special care needed for S3 methods?
fix test failure pertaining to is_linter not being a linter factory.
| I'll try to do a run similar to indentation linter and report my findings some time later. | 
        
          
                R/function_argument_linter.R
              
                Outdated
          
        
      | following-sibling::SYMBOL_FORMALS[not(following-sibling::*[1][self::EQ_FORMALS])]" | ||
| xpath <- paste(glue::glue( | ||
| "//{c('FUNCTION', 'OP-LAMBDA')}/following-sibling::EQ_FORMALS[1]/ | ||
| following-sibling::SYMBOL_FORMALS[not(following-sibling::*[not(self::COMMENT)][1][self::EQ_FORMALS])]" | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: feels like a lot of whitespace here, no?
Fixes #450.
Name chosen so that we can extend this linter to perform other checks on function argument lists in the future.
e.g.
tidyverseusually has defaults for arguments that appear after...