ament_lint_cmake.cmakelint module

Copyright 2009 Richard Quirk

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

https://github.com/richq/cmake-lint/blob/7b85fe46b9bd66fe11ecfef20060f976a49d9662/cmakelint/main.py - removed __version__ import - allow closing parenthesis to be on the same level as the opening one (lines 281-282) - ignore lines with exceeding length if they only contain a single string (lines 35, 196-207) - improve SetFilters ability to parse new filters (lines 89-92) - implement in file pragmas to control filters on a per file basis (lines 389 - 430)

ament_lint_cmake.cmakelint.CheckCommandSpaces(filename, linenumber, clean_lines, errors)

No extra spaces between command and parenthesis

ament_lint_cmake.cmakelint.CheckFileName(filename, errors)
ament_lint_cmake.cmakelint.CheckFindPackage(filename, linenumber, clean_lines, errors)
ament_lint_cmake.cmakelint.CheckIndent(filename, linenumber, clean_lines, errors)
ament_lint_cmake.cmakelint.CheckLineLength(filename, linenumber, clean_lines, errors)

Check for lines longer than the recommended length

ament_lint_cmake.cmakelint.CheckRepeatLogic(filename, linenumber, clean_lines, errors)

Check for logic inside else, endif etc

ament_lint_cmake.cmakelint.CheckStyle(filename, linenumber, clean_lines, errors)

Check style issues. These are: No extra spaces between command and parenthesis Matching spaces between parenthesis and arguments No repeated logic in else(), endif(), endmacro()

ament_lint_cmake.cmakelint.CheckUpperLowerCase(filename, linenumber, clean_lines, errors)

Check that commands are either lower case or upper case, but not both

ament_lint_cmake.cmakelint.CleanComments(line)
class ament_lint_cmake.cmakelint.CleansedLines(lines)

Bases: object

LineNumbers()
ament_lint_cmake.cmakelint.ContainsCommand(line)
ament_lint_cmake.cmakelint.Error(filename, linenumber, category, message)
ament_lint_cmake.cmakelint.GetCommand(line)
ament_lint_cmake.cmakelint.GetCommandArgument(linenumber, clean_lines)
ament_lint_cmake.cmakelint.IsCommandMixedCase(command)
ament_lint_cmake.cmakelint.IsCommandUpperCase(command)
ament_lint_cmake.cmakelint.IsFindPackage(filename)
ament_lint_cmake.cmakelint.IsValidFile(filename)
ament_lint_cmake.cmakelint.ParseArgs(argv)
ament_lint_cmake.cmakelint.ParseOptionFile(contents, ignore_space)
ament_lint_cmake.cmakelint.PrintCategories()
ament_lint_cmake.cmakelint.PrintUsage(message)
ament_lint_cmake.cmakelint.PrintVersion()
ament_lint_cmake.cmakelint.ProcessFile(filename)
ament_lint_cmake.cmakelint.ProcessLine(filename, linenumber, clean_lines, errors)
Arguments:

filename the name of the file linenumber the line number index clean_lines CleansedLines instance errors the error handling function

ament_lint_cmake.cmakelint.ShouldPrintError(category)
ament_lint_cmake.cmakelint.main()