| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| 1 | import platform |
||
| 5 | class IndentBear(CorrectionBasedBear): |
||
| 6 | BINARY = "indent" if platform.system() != "Darwin" else "gindent" |
||
| 7 | RESULT_MESSAGE = "Indentation can be improved." |
||
| 8 | |||
| 9 | def run(self, |
||
| 10 | filename, |
||
| 11 | file, |
||
| 12 | indent_cli_options: str='--k-and-r-style'): |
||
| 13 | """ |
||
| 14 | This bear checks and corrects spacing and indentation via the well |
||
| 15 | known Indent utility. It is designed to work with the C programming |
||
| 16 | language but may work reasonably with syntactically similar languages. |
||
| 17 | |||
| 18 | :param indent_cli_options: Any command line options the indent binary |
||
| 19 | understands. They will be simply passed |
||
| 20 | through. |
||
| 21 | """ |
||
| 22 | for result in self.retrieve_results(filename, |
||
| 23 | file, |
||
| 24 | cli_options=indent_cli_options): |
||
| 25 | yield result |
||
| 26 |