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

Option to exclude files from ament_auto_lint #119

Closed
jacobperron opened this issue Jan 10, 2019 · 3 comments
Closed

Option to exclude files from ament_auto_lint #119

jacobperron opened this issue Jan 10, 2019 · 3 comments
Labels
backlog enhancement New feature or request help wanted Extra attention is needed

Comments

@jacobperron
Copy link
Contributor

It would be convenient if there was a way to exclude one or more files from lint checks when invoking ament_auto_lint.
This would be useful in circumstances were a package includes third-party source files (e.g. tinydir in ros2/rcl#332).
Currently, there is no apparent way to exclude a file other than not running a particular lint check.
Linters could be called separately (ie. not with ament_auto_lint), but some would still need to be extended to support file exclusions.

Implementation considerations

Ideally, we could pass a file exclusion list to ament_auto_lint and let it pass the appropriate flags to the linters it invokes, e.g.

ament_lint_auto_find_test_dependencies(
  EXCLUDE_FILES
    include/foo/bar.h
    src/bar.c
    src/baz.c
)

Another option could be to support placing a file (e.g. ament_lint.cfg) in the root of the repo that allows configuration of the various linters supported by ament_lint.

@jacobperron jacobperron added the enhancement New feature or request label Jan 10, 2019
@jacobperron
Copy link
Contributor Author

cc/ @AAlon

@emersonknapp
Copy link
Contributor

I believe this was closed with #386

@methylDragon
Copy link
Contributor

This issue was also duplicated in #343

I think I will close this.


To exclude files, simply:

    # this must happen before the invocation of ament_package()
    if(BUILD_TESTING)
      find_package(ament_lint_auto REQUIRED)
      set(AMENT_LINT_AUTO_FILE_EXCLUDE /path/to/ignored_file ...)
      ament_lint_auto_find_test_dependencies()
    endif()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants