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

Adds linter for launch files. #54

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions andino_gz/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# .flake8
#
# DESCRIPTION
# Configuration file for the python linter flake8.
#
[flake8]

################### PROGRAM ################################

# Specify the number of subprocesses that Flake8 will use to run checks in parallel.
jobs = auto


################### OUTPUT #################################

########## FORMATTING ##########

# Select the formatter used to display errors to the user.
format = pylint
# Print the total number of errors.
count = True
# Print the source code generating the error/warning in question.
show-source = True
# Count the number of occurrences of each error/warning code and print a report.
statistics = False

################### FILE PATTERNS ##########################

# Provide a comma-separated list of glob patterns to exclude from checks.
exclude =

# Provide a comma-separate list of glob patterns to include for checks.
filename =
*.py


################### LINTING ################################

########## ENVIRONMENT ##########

# Provide a custom list of builtin functions, objects, names, etc.
builtins =


########## OPTIONS ##########

# Set the maximum length that any line (with some exceptions) may be.
max-line-length = 120
# Set the maximum allowed McCabe complexity value for a block of code.
max-complexity = 10
# Toggle whether pycodestyle should enforce matching the indentation of the opening bracket’s line.
# incluences E131 and E133
hang-closing = True


########## RULES ##########

# ERROR CODES
#
# E/W - PEP8 errors/warnings (pycodestyle)
# F - linting errors (pyflakes)
# C - McCabe complexity error (mccabe)
#
# E133 - Closing bracket is missing indentation.
# E226 - Missing whitespace around arithmetic operator.

# Specify a list of codes to ignore.
ignore =
E133,
E226,
# Specify the list of error codes you wish Flake8 to report.
select =
E,
W,
F,
C
6 changes: 6 additions & 0 deletions andino_gz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ install(
share/${PROJECT_NAME}/
)

if(BUILD_TESTING)
find_package(ament_cmake_flake8 REQUIRED)
enable_testing()
ament_flake8("--config" ${CMAKE_CURRENT_SOURCE_DIR}/.flake8)
endif()

ament_package()
2 changes: 2 additions & 0 deletions andino_gz/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
<exec_depend>rviz2</exec_depend>
<exec_depend>xacro</exec_depend>

<test_depend>ament_cmake_flake8</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
Loading