Skip to content

Commit

Permalink
Add eslint message parsing + abs. path removal
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Jan 6, 2024
1 parent 2f46d0b commit 59dc645
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ added to "PATTERNS" to match more messages.

To allow multiline patterns, the python module 'regex' is required.

## OPTIONS

```text
positional arguments:
input Input file. Use '-' for stdin.
output Output file. Use '-' for stdout.
optional arguments:
-h, --help show this help message and exit
-i INPUT_NAMED, --in INPUT_NAMED
Input filename. Overrides positional input.
-o OUTPUT_NAMED, --out OUTPUT_NAMED
Output filename. Overrides positional output.
--root ROOT_PATH Root directory to remove from file paths.
Defaults to working directory.
```

## Examples

Assumes that logToCs.py is available as .github/logToCs.py.
Expand Down
15 changes: 9 additions & 6 deletions logToCs.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,19 +310,22 @@ def main():
)
parser.add_argument(
"-i",
"--input-named",
help="Named input file. Overrides positional input.",
"--in",
dest="input_named",
help="Input filename. Overrides positional input.",
)
parser.add_argument(
"-o",
"--output-named",
help="Named output file. Overrides positional output.",
"--out",
dest="output_named",
help="Output filename. Overrides positional output.",
)
parser.add_argument(
"--root",
metavar="ROOT_PATH",
help="Root directory to remove from file paths",
default=os.path.dirname(os.path.abspath(__file__)),
help="Root directory to remove from file paths."
" Defaults to working directory.",
default=os.getcwd(),
)

args = parser.parse_args()
Expand Down

0 comments on commit 59dc645

Please sign in to comment.