From 3fa1d7d3b01f6247193b42f52853eb99401c925b Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Fri, 7 Jun 2019 12:37:36 +0000 Subject: [PATCH 1/2] Escape backslashes in cpplint.py This gets rid of DeprecationWarning on Windows. Signed-off-by: Chris Lalancette --- ament_cpplint/ament_cpplint/cpplint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ament_cpplint/ament_cpplint/cpplint.py b/ament_cpplint/ament_cpplint/cpplint.py index 75eacc01..b1b925c9 100644 --- a/ament_cpplint/ament_cpplint/cpplint.py +++ b/ament_cpplint/ament_cpplint/cpplint.py @@ -191,7 +191,7 @@ Example file: filter=-build/include_order,+build/include_alpha - exclude_files=.*\.cc + exclude_files=.*\\.cc The above example disables build/include_order warning and enables build/include_alpha as well as excludes all .cc from being @@ -1104,7 +1104,7 @@ def RepositoryName(self): If we have a real absolute path name here we can try to do something smart: detecting the root of the checkout and truncating /path/to/checkout from the name so that we get header guards that don't include things like - "C:\Documents and Settings\..." or "/home/username/..." in them and thus + "C:\\Documents and Settings\\..." or "/home/username/..." in them and thus people on different computers who have checked the source out to different locations won't see bogus errors. """ From ac2470d0eeeb78da84c1c0375f53e417d53057b5 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Fri, 7 Jun 2019 12:43:54 +0000 Subject: [PATCH 2/2] Raw strings in cmakelint.py. This fixes DeprecationWarning on Windows. Signed-off-by: Chris Lalancette --- ament_lint_cmake/ament_lint_cmake/cmakelint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ament_lint_cmake/ament_lint_cmake/cmakelint.py b/ament_lint_cmake/ament_lint_cmake/cmakelint.py index c2c5e6e1..72754bd3 100644 --- a/ament_lint_cmake/ament_lint_cmake/cmakelint.py +++ b/ament_lint_cmake/ament_lint_cmake/cmakelint.py @@ -121,7 +121,7 @@ def Check(self, filename, linenumber, clean_lines, errors): def _GetExpected(self, filename): package = os.path.basename(filename) - package = re.sub('^Find(.*)\.cmake', lambda m: m.group(1), package) + package = re.sub(r'^Find(.*)\.cmake', lambda m: m.group(1), package) return package.upper() def Done(self, filename, errors): @@ -332,7 +332,7 @@ def CheckStyle(filename, linenumber, clean_lines, errors): CheckRepeatLogic(filename, linenumber, clean_lines, errors) def CheckFileName(filename, errors): - name_match = re.match('Find(.*)\.cmake', os.path.basename(filename)) + name_match = re.match(r'Find(.*)\.cmake', os.path.basename(filename)) if name_match: package = name_match.group(1) if not package.isupper():