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

Implement EXCLUDE #1

Closed
mikepurvis opened this issue Sep 10, 2013 · 5 comments
Closed

Implement EXCLUDE #1

mikepurvis opened this issue Sep 10, 2013 · 5 comments
Assignees

Comments

@mikepurvis
Copy link
Member

To eliminate files from linting (eg, tests, files which come from elsewhere, etc).

Should support individual files or globs.

@jack-oquin
Copy link
Member

I would prefer to simplify the commands so they always take a list of the files needing lint processing. That makes generating the names more flexible, while showing it explicitly in the CMakeLists.txt.

file(GLOB_RECURSE ${PROJECT_NAME}_PYTHON_SRCS *.py)
roslint_python(${${PROJECT_NAME}_PYTHON_SRCS})

Exclude can then be done as usual in CMake, and we can do more complex globbing. Supposing the executable scripts have no .py suffix:

file(GLOB_RECURSE ${PROJECT_NAME}_PYTHON_MODS src *.py)
list(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_MODS 
     src/${PROJECT_NAME}/foo.py
     src/${PROJECT_NAME}/bar.py)
file(GLOB ${PROJECT_NAME}_PYTHON_SCRIPTS scripts *)
roslint_python(${${PROJECT_NAME}_PYTHON_MODS} 
               ${${PROJECT_NAME}_PYTHON_SCRIPTS})

@mikepurvis
Copy link
Member Author

That makes sense to me—let's do it that way.

@jack-oquin
Copy link
Member

OK.

Aside from documentation, it will be simple to implement.

@ghost ghost assigned jack-oquin Sep 13, 2013
jack-oquin added a commit that referenced this issue Sep 13, 2013
untested: still need unit test cases
@jack-oquin
Copy link
Member

The commit above looks like it should work, but has not been tested.

I'll keep this issue open until we have unit tests that demonstrate that it works as expected.

As coded, the list of sources may be empty. Pylint will complain in that case. A better solution would test for it and print a warning message, instead.

@jack-oquin
Copy link
Member

The unit tests seem to be working OK now. Closing this issue.

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

No branches or pull requests

2 participants