summaryrefslogtreecommitdiffstats
path: root/lib/python/qmk/tests
Commit message (Collapse)AuthorAgeFilesLines
* Remove references to info.json `width` and `height` in CLI (#13728)Ryan2021-07-292-4/+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-254-6/+44
|\|
| * Add a `qmk format-json` command that will format JSON files (#12372)Zach White2021-03-254-6/+44
| | | | | | | | | | | | | | | | | | | | | | * 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-054-51/+57
| | | | | | | * 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
* Generate api data on each push (#10609)Zach White2020-10-251-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add new qmk generate-api command, to generate a complete set of API data. * Generate api data and push it to the keyboard repo * fix typo * Apply suggestions from code review Co-authored-by: Joel Challis <git@zvecr.com> * fixup api workflow * remove file-changes-action * use a more mainstream github action * fix yaml error * Apply suggestions from code review Co-authored-by: Erovia <Erovia@users.noreply.github.com> * more uniform date handling * make flake8 happy * Update lib/python/qmk/decorators.py Co-authored-by: Erovia <Erovia@users.noreply.github.com> Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: Erovia <Erovia@users.noreply.github.com>
* [CLI] Add c2json (#8817)Erovia2020-10-062-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-062-1/+4
|
* 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-262-2/+8
| | | 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
* Use pathlib everywhere we can (#7872)skullydazed2020-02-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | * Use pathlib everywhere we can * Update lib/python/qmk/path.py Co-Authored-By: Erovia <Erovia@users.noreply.github.com> * Update lib/python/qmk/path.py Co-Authored-By: Erovia <Erovia@users.noreply.github.com> * Improvements based on @erovia's feedback * rework qmk compile and qmk flash to use pathlib * style * Remove the subcommand_name argument from find_keyboard_keymap() Co-authored-by: Erovia <Erovia@users.noreply.github.com>
* 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'
* Add pep8-naming to our python lintingskullY2019-12-011-1/+1
|
* 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-122-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Small CLI cleanupsskullY2019-11-123-3/+2
| | | | | | | * yapf changes * Fix the cformat test * Make the normpath test work when run from / * `qmk config`: Mark `--read-only` as arg_only
* MILC: Use dashes instead of underscores for subcommandsErovia2019-10-231-1/+1
| | | | | | | The subcommand functions' name follows the Python convention of using snake case, but looks odd on the command line. Fix it by converting underscores to dashes, eg.: list_keyboards -> list-keyboards.
* [CLI] Add `qmk list_keyboards` (#6927)Dan McClain2019-10-071-0/+8
| | | | | | | | | `list_keyboards` replicates the `make list-keyboards` by globbing for all paths that include `rules.mk` and then removing the paths that include `keymaps`. This basis of this cli command could be reused in the future as a util, but is not done so here since this would be the only place that would use it currently Resolves #6911
* Configuration system for CLI (#6708)skullydazed2019-09-221-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rework how bin/qmk handles subcommands * qmk config wip * Code to show all configs * Fully working `qmk config` command * Mark some CLI arguments so they don't pollute the config file * Fleshed out config support, nicer subcommand support * sync with installable cli * pyformat * Add a test for subcommand_modules * Documentation for the `qmk config` command * split config_token on space so qmk config is more predictable * Rework how subcommands are imported * Document `arg_only` * Document deleting from CLI * Document how multiple operations work * Add cli config to the doc index * Add tests for the cli commands * Make running the tests more reliable * Be more selective about building all default keymaps * Update new-keymap to fit the new subcommand style * Add documentation about writing CLI scripts * Document new-keyboard * Update docs/cli_configuration.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update docs/cli_development.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update docs/cli_development.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update docs/cli_development.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Address yan's comments. * Apply suggestions from code review suggestions from @noahfrederick Co-Authored-By: Noah Frederick <code@noahfrederick.com> * Apply suggestions from code review Co-Authored-By: Noah Frederick <code@noahfrederick.com> * Remove pip3 from the test runner
* run yapf on the codeskullY2019-09-074-1/+5
|
* Setup a python test frameworkskullY2019-09-076-0/+51