Skip to content

object_camel_case_linter is over-eager #108

@klmr

Description

@klmr

I get multiple errors “Variable and function names should be all lowercase” for using predefined names such as .GlobalEnv or getRegisteredNamespace (the latter is an internal name, called via .Internal(getRegisteredNamespace(…))) or context$cppSourceFilename.

All of these cases are names from elsewhere that my package is using, not defining. In other words, I have no control over them. Currently, the linter only excludes names found in attached packages but as the above shows, this leads to many false positives. Ideally, the linter should only complain about names that are defined in the package (i.e. that are on the left side of an assignment operator or, optionally, the first argument of assign, or are inside a function argument definition).

There’s one complication in the proposal: it needs to special-case c and list calls to ensure that the following code raises the warning:

x = list(fooBar = 1)

The same is probably true for object_snake_case_linter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions