add code and style checking to test/build (flake8); support --args flag (#126)

This commit is contained in:
Chad Smith 2017-11-15 17:52:06 -08:00
parent 8830278285
commit 04ec5b0718
5 changed files with 16 additions and 4 deletions

View file

@ -26,7 +26,7 @@ matrix:
before_install:
# install collective.checkdocs to allow for python setup.py test command to work
- pip install collective.checkdocs
- pip install -r dev_requirements.txt
- yarn install
# commands for linux
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install gdb ; fi

View file

@ -3,7 +3,9 @@
## dev
Changes that are in master but have not yet been pushed to PyPI.
* Optional authentication
* Add optional authentication (@nickamon, issue #132)
* Support the `--args` flag (issue #126)
* Ensure code is correct and adheres to recommended Python style when running tests/building (flake8)
## 0.8.1.0
* Add autocomplete functionality (@bobthekingofegypt, issue #129)

View file

@ -1 +1,2 @@
collective.checkdocs==0.2
flake8==3.5.0

View file

@ -432,7 +432,7 @@ def main():
'Pass this flag when debugging gdbgui itself to automatically reload the server when changes are detected', action='store_true')
parser.add_argument('-n', '--no_browser', help='By default, the browser will open with gdb gui. Pass this flag so the browser does not open.', action='store_true')
parser.add_argument('-x', '--gdb_cmd_file', help='Execute GDB commands from file.')
parser.add_argument('--args', nargs='+', help='(Optional) The binary and arguments to run in gdb. Example: gdbgui --args "./mybinary myarg -flag1 -flag2"')
parser.add_argument('--auth-file', help='Specify a file that contains the HTTP Basic auth username and password separate by newline. NOTE: gdbgui does not use https.')
args = parser.parse_args()
@ -441,7 +441,15 @@ def main():
print(__version__)
return
app.config['initial_binary_and_args'] = ' '.join(args.cmd)
if len(args.cmd) and len(args.args):
print('Cannot specify command and args. Must specify one or the other.')
exit(1)
print(args.args)
if args.cmd:
cmd = args.cmd
else:
cmd = args.args
app.config['initial_binary_and_args'] = ' '.join(cmd or [])
app.config['gdb_path'] = args.gdb
app.config['gdb_cmd_file'] = args.gdb_cmd_file
app.config['show_gdbgui_upgrades'] = not args.hide_gdbgui_upgrades

View file

@ -1,6 +1,7 @@
# run pip install -r dev_requirements.txt before running make test
.PHONY: test publish
test:
flake8 gdbgui/backend.py --ignore=E121,E123,E126,E128,E501
python setup.py test
yarn build
python setup.py checkdocs