| 45 | return fname |
| 46 | |
| 47 | def run_cmd(self, cmd, rel_fname, code): |
| 48 | cmd += " " + oslex.quote(rel_fname) |
| 49 | |
| 50 | returncode = 0 |
| 51 | stdout = "" |
| 52 | try: |
| 53 | returncode, stdout = run_cmd_subprocess( |
| 54 | cmd, |
| 55 | cwd=self.root, |
| 56 | encoding=self.encoding, |
| 57 | ) |
| 58 | except OSError as err: |
| 59 | print(f"Unable to execute lint command: {err}") |
| 60 | return |
| 61 | errors = stdout |
| 62 | if returncode == 0: |
| 63 | return # zero exit status |
| 64 | |
| 65 | res = f"## Running: {cmd}\n\n" |
| 66 | res += errors |
| 67 | |
| 68 | return self.errors_to_lint_result(rel_fname, res) |
| 69 | |
| 70 | def errors_to_lint_result(self, rel_fname, errors): |
| 71 | if not errors: |