summaryrefslogtreecommitdiffstats
path: root/lib/python/qmk/tests/test_cli_commands.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix test logic to check for both keymaps (#17761)Niko Wenselowski2022-07-231-5/+10
| | | | | | | | | | | Python will evaluate first the left and then the right side of the and operator. The left side would previously return True based on the truthiness logic that treats any non-emptry string as true. It would not check if the desired keymap exists. If the left side is true it will evaluate the right side which will check for the existance of a specific keymap. With this change the check for existance of two keymaps is implemented.
* Add support for linting deprecated and removed functionality (#17063)Joel Challis2022-06-091-1/+0
| | | | | | | | | * Add support for more lint warnings/errors * Develop currently needs extra deps installed * Lint a few more scenarios * fix tests
* Map data driven `DESCRIPTION` as string literal (#16523)Ryan2022-03-051-1/+1
|
* Merge remote-tracking branch 'origin/master' into developQMK Bot2022-02-281-0/+12
|\
| * CLI: Validate JSON keymap input (#16261)Erovia2022-02-281-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix schema validator It should use the passed schema. * Add required attributes to keymap schema * Rework subcommands to validate the JSON keymaps The 'compile', 'flash' and 'json2c' subcommands were reworked to add JSON keymap validation so error is reported for non-JSON and non-compliant-JSON inputs. * Fix required fields in keymap schema * Add tests * Fix compiling keymaps directly from keymap directory * Schema should not require version for now.
* | Rework generate-api CLI command to use .build directory (#16441)Joel Challis2022-02-271-1/+1
|/
* Fix issues with Python Tests (#16162)Drashna Jaelre2022-02-021-1/+1
| | | | | | | | | | | * Reformat python due to yapf changes * Fix pytest keymap list test * revert formatting * Use contra, because, well https://www.reddit.com/r/MechanicalKeyboards/comments/8riofq/did_i_kill_my_contra/
* Macros in JSON keymaps (#14374)Zach White2021-11-221-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * macros in json keymaps * add advanced macro support to json * add a note about escaping macro strings * add simple examples * format json * add support for language specific keymap extras * switch to dictionaries instead of inline text for macros * use SS_TAP on the innermost tap keycode * add the new macro format to the schema * document the macro limit * add the json keyword for syntax highlighting * fix format that vscode screwed up * Update feature_macros.md * add tests for macros * change ding to beep * add json support for SENDSTRING_BELL * update doc based on feedback from sigprof * document host_layout * remove unused var * improve carriage return handling * support tab characters as well * Update docs/feature_macros.md Co-authored-by: Nick Brassel <nick@tzarc.org> * escape backslash characters * format * flake8 * Update quantum/quantum_keycodes.h Co-authored-by: Nick Brassel <nick@tzarc.org>
* Merge remote-tracking branch 'origin/master' into developDrashna Jael're2021-11-191-2/+2
|\
| * Add diff logic to python format subcommand (#15156)Joel Challis2021-11-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | * Add diff logic to python format subcommand * Update test * Add in filter per format-c * fix tests * Update new workflow
* | Map `PRODUCT` define to `keyboard_name` (#14372)Ryan2021-11-051-5/+5
| | | | | | | | | | | | | | * Map `PRODUCT` define to `keyboard_name` * Fix tests * Fix last test
* | Remove bin/qmk (#14231)Zach White2021-08-291-1/+1
|/ | | | | * Remove the bin/qmk script * remove bin/qmk from workflows
* Remove references to info.json `width` and `height` in CLI (#13728)Ryan2021-07-291-2/+2
|
* CLI/Docs: Fix the format commands' name (#13668)Erovia2021-07-231-6/+6
| | | | | | | PR #13296 changed the name of the `cformat` and `pyformat` commands to `format-c` and `format-py` respectively. This PR updates the documentation and some parts of the CLI to use the new names. Also add documentation for the new `format-text` subcommand, introduced in the same PR.
* CLI: Add subcommand to generate version.h (#13151)Ryan2021-06-271-0/+6
|
* Merge remote-tracking branch 'origin/master' into developZach White2021-05-191-5/+4
|\ | | | | | | | | | | Resolved Conflicts: lib/python/qmk/tests/test_cli_commands.py util/install/fedora.sh
| * Align our subprocess usage with current best practices. (#12940)Zach White2021-05-191-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Align our subprocess usage with current best practices. * remove unused import * Apply suggestions from code review Co-authored-by: Ryan <fauxpark@gmail.com> * fix the cpp invocation for older python * allow for unprompted installation * make sure qmk new-keyboard works on windows Co-authored-by: Ryan <fauxpark@gmail.com>
* | Use milc.subcommand.config instead of qmk.cli.config (#12915)Zach White2021-05-161-6/+0
| | | | | | | | | | | | | | * Use milc.subcommand.config instead * pyformat * remove the config test
* | Merge remote-tracking branch 'origin/master' into developQMK Bot2021-05-101-3/+13
|\|
| * Improve our CI tests (#11476)Zach White2021-05-101-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add a test and dry-run to qmk generate-api * add a dry-run to qmk pyformat * Add a --dry-run to qmk cformat * reverse the order of nose2 and flake8 tests * run CI test against cformat and pyformat * fix programming errors * tweak job name * fix argument * refine the files we select * fix stack trace in --ci * make cformat exit clean * fix c file extensions * decouple CI from pyformat * remove --ci arg * make ci happy * use the environment var instead * change output to text * fix log message * replace tabs
* | Merge remote-tracking branch 'origin/master' into developQMK Bot2021-03-251-0/+24
|\|
| * Add a `qmk format-json` command that will format JSON files (#12372)Zach White2021-03-251-0/+24
| | | | | | | | | | | | | | | | | | | | | | * Add a command to format json files * change to work after rebase * add test for qmk format-json * add documentation for qmk format-json * Update lib/python/qmk/cli/format/json.py
* | Merge remote-tracking branch 'origin/master' into developQMK Bot2021-03-241-2/+2
|\|
| * Add support for qmk_configurator style aliases (#11954)Zach White2021-03-241-2/+2
| | | | | | | | | | | | | | | | | | * Add support for qmk_configurator style aliases * add the keyboard aliases to the api data * add support for a keyboard metadata file * make flake8 happy
* | Begin the process of deprecating bin/qmk in favor of the global cli (#12109)Zach White2021-03-071-2/+2
|/ | | | | * Begin the process of deprecating bin/qmk in favor of the global cli * Correctly set the qmk bin
* Fix develop (#12039)Zach White2021-02-271-1/+1
| | | | | | | | | Fixes file encoding errors on Windows, and layouts not correctly merging into info.json. * force utf8 encoding * correctly merge layouts and layout aliases * show what aliases point to
* Create a system to map between info.json and config.h/rules.mk (#11548)Zach White2021-01-311-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | * generate rules.mk from a json mapping * generate rules.mk from a json mapping * support for config.h from json maps * improve the mapping system * document the mapping system * move data/maps to data/mappings * fix flake8 errors * fixup LED_MATRIX_DRIVER * remove product and description from the vision_division keymap level * reduce the complexity of generate-rules-mk * add tests for the generate commands * fix qmk doctor when submodules are not clean
* Migrate python tests away from onekey (#11367)Joel Challis2021-01-051-31/+37
| | | | | | | * Migrate python tests away from onekey * Add stub files to stop lint complaints * Make all the pytest keymaps compile
* [CLI] Add stdin support for json2c command (#11289)LongerHV2020-12-291-1/+28
| | | | | | | | | | | | | | | * Implement stdin for json2c command * Refactor * Handle json decode error * Add stdin support for c2json cli command * Refactor to prevent code duplication * Change exit(1) to return False in c2json command * Remove unused import
* CLI-ify rgblight_breathing_table_calc.c (#11174)Ryan2020-12-161-0/+7
| | | | Co-authored-by: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Co-authored-by: Zach White <skullydazed@drpepper.org>
* Reduce travis load by replacing an exclusive grep with an inclusive grep ↵Zach White2020-11-301-1/+1
| | | | | | | (#10964) * add -n to avoid compiling * switch to an include rather than exclude strategy
* CLI: Udev related fixes and improvements (#10736)Erovia2020-11-161-12/+12
|
* CLI: Add `qmk clean` (#10785)Ryan2020-11-041-0/+6
|
* `qmk info`: Add `--ascii` flag (#10793)Ryan2020-11-021-2/+15
| | | | | | | | | | | | | | | * `qmk info`: Add `--ascii` flag * Fix typo * Force ASCII for Windows/MSYS2 * Make it gooder * Remove redundant windows check * ...And this too * Make pytest work on Windows
* [CLI] Add c2json (#8817)Erovia2020-10-061-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Basic keymap parsing finally works * Add 'keymap.json' creation to the qmk.keymap module * Add tests and fix formatting * Fix/exclude flake8 errors * Convert keymap.c to valid keymap.json * Fix some errors * Add tests * Finalize keymap.json creation, add json template * Add docs * Move pygments to the standard requirements * Add support for nameless layers, fix tests * Fix things after rebase * Add missing 'keymap' value. * Fix missing layer numbers from advanced keycodes Buckwich noticed that if the advanced keycode / layer toggling key contains a number, it goes missing. Now we properly handle them. Thx for noticing! * Apply suggestions from code review * fixup tests Co-authored-by: Zach White <skullydazed@drpepper.org> Co-authored-by: skullY <skullydazed@gmail.com>
* CLI: update subcommands to use return instead of exit() (#10323)Ryan2020-10-061-1/+2
|
* Parse version better in `qmk doctor` GCC version checks (#9324)Ryan2020-06-181-4/+4
|
* [CLI] Add a subcommand for getting information about a keyboard (#8666)Zach White2020-05-261-21/+83
| | | | | You can now use `qmk info` to get information about keyboards and keymaps. Co-authored-by: Erovia <Erovia@users.noreply.github.com>
* CLI: fix `json2c` subcommand and add/fix tests (#9206)Erovia2020-05-261-0/+6
| | | Co-authored-by: Zach White <skullydazed@users.noreply.github.com>
* Adding unit tests for list-keymaps command (#7711)codecoffeecode2020-05-161-10/+26
| | | | Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> Co-Authored-By: Erovia <Erovia@users.noreply.github.com>
* CLI: More MSYS2 fixes (#8577)Erovia2020-03-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * CLI: More MSYS2 fixes Now I can fully setup and work with qmk_firmware on an MSYS2 installation without any errors or exceptions. * Apply suggestions from code review Co-Authored-By: skullydazed <skullydazed@users.noreply.github.com> * Some improvements * Remove unnecessary import * Remove slow, unused code Getting the version from GIT was slow on both Windows and Docker. Until we find a better, faster way, this is removed. * remove unused imports * Implement @vomindoraan's suggestions * refine how we pick the shell to use * Apply @fauxpark's suggestions fauxpark investigated the topic of shells in MSYS2 a bit and we come to the conclusion that the safest bet was to just use the user's shell. Anything more just opens up more edge-cases than it solves. Co-Authored-By: Ryan <fauxpark@gmail.com> * Use `platform_id` in doctor This will bring it in line with the new code. Co-authored-by: skullydazed <skullydazed@users.noreply.github.com> Co-authored-by: skullY <skullydazed@gmail.com> Co-authored-by: Ryan <fauxpark@gmail.com>
* New functionality for cformat (#7893)Akaash Suresh2020-02-221-1/+2
| | | | | | | | | | | | | Fixing complexity remove lambda PR review fixes #1 Removing unneccesary string substitution Handle -a and specified files Complexity rewrite, use pathlib
* Code cleanup, use pathlib, use pytest keyboardErovia2020-02-151-2/+2
| | | | | | | | Clean up checks and logics that are unnecessary due to MILC updates. Use pathlib instead of os.path for readability. Use the 'pytest' keyboard for the tests. Add community layout for 'handwired/onekey/pytest' so we can test community layouts.
* Fix commandline parsing and flake8 findings, rebaseErovia2020-02-151-1/+8
| | | | | Fixed commandline and config parsing. Thx @xplusplus. Rebased on master and fixed merge conflicts.
* Add test for list_keymapsErovia2020-02-151-0/+5
|
* CI: Add workflow for CLI testing (#7357)Joel Challis2020-02-081-1/+1
| | | Create GitHub Actions cli test workflow and remove travis runs of 'qmk pytest'
* format code according to conventions [skip ci]QMK Bot2019-11-161-0/+2
|
* Add CLI command for flashing a keyboardjorgemanzo2019-11-151-0/+3
| | | | | | | | A new CLI subcommand was added, flash, which behaves very similar to the already present compile CLI comamnd, but with the added ability to target a bootloader. The command is used like so: qmk flash [-h] [-b] [-kb KEYBOARD] [-km KEYMAP] [-bl BOOTLOADER] [filename]. A -kb <keyboard> and -km <keymap> is expected, or a configurator export JSON filename. A bootloader can be specified using -bl <target>, and if left unspecified, the target is assumed to be :flash. -bl can be used to list the available bootloaders. If -km <keymap> is provided, but no -kb <keyboard>, then a message is printed suggesting the user to run qmk list_keyboards.
* format code according to conventions [skip ci]QMK Bot2019-11-131-0/+2
|
* Add cli convert subcommand, from raw KLE to JSON (#6898)Cody Bender2019-11-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add initial pass at KLE convert * Add cli log on convert * Move kle2xy, add absolute filepath arg support * Add overwrite flag, and context sensitive conversion * Update docs/cli.md * Fix converter.py typo * Add convert unit test * Rename to kle2qmk * Rename subcommand * Rename subcommand to kle2json * Change tests to cover rename * Rename in __init__.py * Update CLI docs with new subcommand name * Fix from suggestions in PR #6898 * Help with cases of case sensitivity * Update cli.md * Use angle brackets to indicate required option * Make the output text more accurate