Skip to content

Conversation

@projectgus
Copy link
Contributor

@projectgus projectgus commented Aug 9, 2023

If you run a linter in your editor or other part of your workflow then checking undefined-name (F821) is excellent for quickly catching typos, missing imports, etc.

This is the sibling PR to micropython/micropython#12197

Changes include:

  • Some minor bug fixes due to missing imports, copy/pasted code from elsewhere, etc.
  • Some needless changes to make the linter happy.
  • Global ignores for manifest.py files and the aioble multitests.

This PR does not include the fix from #713, so workflow run will fail until it can be rebased to include it. (:heavy_check_mark: )


This work was funded by GitHub sponsors.

Looks like copy-pasta from bmi270 driver.

There is a soft reset capability documented in the BMM150 datasheet, but it
uses different register bits and I don't have a BMM150 at hand to test it.

Found by Ruff checking F821.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
Driver calls time.sleep_ms() in one place.

Found by Ruff checking F821.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
Found by Ruff checking F821.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
Found by Ruff checking F821.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
These were probably intentional missing names, however raising
NotImplementedError or KeyError is more explicit than trying to call an
unknown function.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
This is a change just to make the linter happy, the code
probably would have run OK without it.

Found by Ruff checking F821.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
As-written this code is unreachable (return statement two line above),
so this change is really just to make the linter happy.

Found by Ruff checking F821.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
Also adds some global ignores for manifest files (which have implicit
imports) and the multitests (which have the same).

Other F821 fixes or accommodations are in the parent commits to this
commit.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
@dpgeorge dpgeorge force-pushed the bugfix/ruff_enable_f821 branch from bd2df6f to 5b6fb2b Compare August 22, 2023 12:45
@dpgeorge dpgeorge merged commit 5b6fb2b into micropython:master Aug 22, 2023
@dpgeorge
Copy link
Member

Thank you!

@projectgus projectgus deleted the bugfix/ruff_enable_f821 branch August 23, 2023 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants