coala / coala/coala-quickstart
CLI argument parsing problems
- Dominant language
- Python
- Stars
- 49
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Description
quickstart uses `coalib`, which relies heavily on the CLI and config loading routines.
`get_filtered_bears` is called, and it uses `load_configuration` , which calls `coalib.parsing.DefaultArgParser.default_arg_parser`, which is in fact the only arg parser and all coala apps are implicitly using.
The CLI arg parsing occurs after a bit of initial interaction with the user. e.g. if we use `--foo`, the error message uses the wrong program name, and shows all generic coala args as being valid.
```
$ coala-quickstart --foo
.o88Oo._
d8P .ooOO8bo._ Hi there! Awesome you decided to do some
88 '*Y8bo. high quality coding. coala is just the
YA '*Y8b __ tool you need!
YA 68o68**8Oo.
"8D *"' "Y8o You can configure coala to suit your
Y8 'YB .8D needs. This is done with a settings file
'8 d8' 8D called a `.coafile` in the project
8 d8888b d AY directory.
Y, d888888 d' _.oP"
q. Y8888P' d8 We can help you with that. Let's get
"q. `Y88P' d8" started with some basic questions.
Y ,o8P
oooo888P"
What is your project directory? [/tmp]
The contents of your .gitignore file for the project will be automatically loaded as the files to ignore.
The following languages have been automatically detected:
Go: 42%
C++: 8%
Python: 7%
HTML: 2%
JavaScript: 2%
C#: 1%
Java: 1%
Markdown: 1%
YAML: 0%
CSS: 0%
Ruby: 0%
PHP: 0%
XML: 0%
C: 0%
usage: coala [-h] [-v] [-c FILE] [-F] [-I] [-s [FILE]] [--disable-caching]
[--flush-cache] [-b NAME [NAME ...]] [-f FILE [FILE ...]]
[-i FILE [FILE ...]] [--limit-files FILE [FILE ...]]
[-d DIR [DIR ...]] [-V] [-L ENUM] [-m ENUM] [-B]
[-l LANG [LANG ...]] [-p LANG [LANG ...]] [-D] [--show-details]
[-S SETTING [SETTING ...]] [-a] [-j JOBS] [-n]
[TARGETS [TARGETS ...]]
coala: error: unrecognized arguments: --foo
```
As best I can tell, all of these options are discarded, but I am still investigating that
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at coala.parsing.DefaultArgParser.default_arg_parser and trace how get_filtered_bears reaches load_configuration during quickstart. Reproduce the `coala-quickstart --foo` flow, then determine why parsing happens after the initial interaction. Done means invalid arguments report the quickstart program name and do not expose unrelated generic coala options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100