Parses the given command line parameter for file- and line-specific exclusions. readability/casting:file.cpp readability/casting:file.cpp:43 Args: parameter: The parameter value of --filter Returns: [category, filename, line]. Category is always given. F
(parameter)
| 7918 | |
| 7919 | |
| 7920 | def _ParseFilterSelector(parameter): |
| 7921 | """Parses the given command line parameter for file- and line-specific |
| 7922 | exclusions. |
| 7923 | readability/casting:file.cpp |
| 7924 | readability/casting:file.cpp:43 |
| 7925 | |
| 7926 | Args: |
| 7927 | parameter: The parameter value of --filter |
| 7928 | |
| 7929 | Returns: |
| 7930 | [category, filename, line]. |
| 7931 | Category is always given. |
| 7932 | Filename is either a filename or empty if all files are meant. |
| 7933 | Line is either a line in filename or -1 if all lines are meant. |
| 7934 | """ |
| 7935 | colon_pos = parameter.find(":") |
| 7936 | if colon_pos == -1: |
| 7937 | return parameter, "", -1 |
| 7938 | category = parameter[:colon_pos] |
| 7939 | second_colon_pos = parameter.find(":", colon_pos + 1) |
| 7940 | if second_colon_pos == -1: |
| 7941 | return category, parameter[colon_pos + 1 :], -1 |
| 7942 | return ( |
| 7943 | category, |
| 7944 | parameter[colon_pos + 1 : second_colon_pos], |
| 7945 | int(parameter[second_colon_pos + 1 :]), |
| 7946 | ) |
| 7947 | |
| 7948 | |
| 7949 | def _ExpandDirectories(filenames): |
no test coverage detected
searching dependent graphs…