Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning logic when running 'qmk format -a' #11177

Merged
merged 1 commit into from
Dec 10, 2020

Conversation

zvecr
Copy link
Member

@zvecr zvecr commented Dec 10, 2020

Description

Was producing the following error:

qmk cformat -a
<class 'TypeError'>
☒ sequence item 0: expected str instance, PosixPath found
Traceback (most recent call last):
  File "/home/zvecr/.local/lib/python3.8/site-packages/milc/milc.py", line 415, in __call__
    return self.__call__()
  File "/home/zvecr/.local/lib/python3.8/site-packages/milc/milc.py", line 420, in __call__
    return self._entrypoint(self)
  File "/home/zvecr/qmk_firmware/lib/python/qmk/cli/cformat.py", line 65, in cformat
    cformat_run(files, cli.args.all_files)
  File "/home/zvecr/qmk_firmware/lib/python/qmk/cli/cformat.py", line 27, in cformat_run
    cli.log.warning('Filenames passed with -a, only formatting: %s', ','.join(files))

However on further inspection the condition for when the warning should be displayed was also in the wrong place. Which triggered the warning to always print out, even when zero files were passed.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@zvecr zvecr added the bug label Dec 10, 2020
@zvecr zvecr requested review from Erovia, skullydazed and a team December 10, 2020 18:15
@github-actions github-actions bot added cli qmk cli command python labels Dec 10, 2020
@zvecr zvecr merged commit 5b5d74a into qmk:master Dec 10, 2020
ahaurw01 added a commit to ahaurw01/qmk_firmware that referenced this pull request Dec 11, 2020
* upstream/master: (44 commits)
  Fixed french quotes on canadian multilingual (qmk#11183)
  Nightingale Studios Hailey production fixes (qmk#11180)
  CI automated format fixes (qmk#11179)
  Add XD75am as supported in XD75 readme (qmk#11170)
  Normalise include statements in core code (qmk#11153)
  Fix warning logic when running 'qmk format -a' (qmk#11177)
  CI: Add workflow for codebase formatting (qmk#7382)
  add Via keymap for beatervan (qmk#11159)
  add VIA keymap for edc40 (qmk#11160)
  Use progmem.h for claw44 glcdfont (qmk#11164)
  [Keyboard] Valor FRL TKL update - EEPROM change (qmk#11163)
  Fixup config template to match <> instead of "" for includes. (qmk#11166)
  Fix titan60 and h660 error_log complaints (qmk#11124)
  [Keymap] Fix rules.mk for nullbits nibble oled keymap (qmk#11142)
  [Keyboard] Geekboards Macropad V2 keyboard (qmk#11045)
  Fixed taleguers75 info.json (qmk#11121)
  Add missing hardware availability for Plank EZ (qmk#11069)
  [Keyboard] Big Dill Extended by MechWild (qmk#11047)
  add via layout for aek2 usb pcb (qmk#11125)
  [Keyboard] Add nt980 (qmk#11092)
  ...
nicsuzor added a commit to nicsuzor/qmk_firmware that referenced this pull request Dec 16, 2020
* upstream/master: (183 commits)
  Normalise include statements in keyboard code (qmk#11185)
  CLI-ify rgblight_breathing_table_calc.c (qmk#11174)
  gh60/satan: fix indicator LED define (qmk#11216)
  [Keymap] Helix default keymap oled update (qmk#11152)
  [Keyboard] rart/rart45 (qmk#11096)
  Selectively enable command and console for yanfali userspace (qmk#11212)
  Another attempt to fix formatting workflow (qmk#11187)
  Add i2c 24LC64 eeprom (qmk#11200)
  Fix incorrect search order for `rgblight_breathe_table.h` that `rgblight.c` includes. (qmk#11192)
  Fixed french quotes on canadian multilingual (qmk#11183)
  Nightingale Studios Hailey production fixes (qmk#11180)
  CI automated format fixes (qmk#11179)
  Add XD75am as supported in XD75 readme (qmk#11170)
  Normalise include statements in core code (qmk#11153)
  Fix warning logic when running 'qmk format -a' (qmk#11177)
  CI: Add workflow for codebase formatting (qmk#7382)
  add Via keymap for beatervan (qmk#11159)
  add VIA keymap for edc40 (qmk#11160)
  Use progmem.h for claw44 glcdfont (qmk#11164)
  [Keyboard] Valor FRL TKL update - EEPROM change (qmk#11163)
  ...
xgnxs pushed a commit to xgnxs/qmk_firmware that referenced this pull request Jan 9, 2021
drashna pushed a commit to zsa/qmk_firmware that referenced this pull request Jan 13, 2021
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cli qmk cli command python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants