farm-ng/amiga-dev-kit

CI pre-commit failing with weird error message

Closed this issue · 2 comments

Bug happening in this PR: #224

Bug apparently started showing on commit 24192eb
This is the pre-commit log:

/opt/hostedtoolcache/Python/3.12.0/x64/bin/pre-commit run --show-diff-on-failure --color=always --all-files
[INFO] Initializing environment for https://github.com/psf/black.
[INFO] Initializing environment for https://github.com/igorshubovych/markdownlint-cli.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/asottile/reorder_python_imports.
[INFO] Initializing environment for https://github.com/PyCQA/flake8.
[INFO] Initializing environment for https://github.com/codespell-project/codespell.
[INFO] Initializing environment for https://github.com/myint/docformatter.
[INFO] Installing environment for https://github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/igorshubovych/markdownlint-cli.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/asottile/reorder_python_imports.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/PyCQA/flake8.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/codespell-project/codespell.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/myint/docformatter.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
black....................................................................Passed
markdownlint-fix.........................................................Passed
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check json...............................................................Passed
Reorder python imports...................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

circuitpy/lib/farm_ng/utils/main_loop.py:50:33: E231 missing whitespace after ':'
circuitpy/lib/farm_ng/utils/main_loop.py:117:29: E231 missing whitespace after ':'
circuitpy/lib/farm_ng/utils/main_loop.py:117:42: E226 missing whitespace around arithmetic operator
circuitpy/lib/farm_ng/utils/main_loop.py:117:50: E231 missing whitespace after ':'
circuitpy/lib/farm_ng/utils/main_loop.py:154:51: E231 missing whitespace after ':'
circuitpy/lib/farm_ng/utils/main_loop.py:239:29: E231 missing whitespace after ':'
circuitpy/lib/farm_ng/utils/main_loop.py:239:42: E226 missing whitespace around arithmetic operator
circuitpy/lib/farm_ng/utils/main_loop.py:239:50: E231 missing whitespace after ':'

codespell................................................................Passed
docformatter.............................................................Passed
Error: The process '/opt/hostedtoolcache/Python/3.12.0/x[64](https://github.com/farm-ng/amiga-dev-kit/actions/runs/6661266626/job/18103862858#step:6:66)/bin/pre-commit' failed with exit code 1

We (@Hackerman342 and I) never touched file circuitpy/lib/farm_ng/utils/main_loop.py .

This is what I've tried so far (without success):

  • Deleting my local branch, checking it out again and pushing a new commit
  • Checking out commit 24192eb, going into detached HEAD state, checking out a new branch, and creating a new PR
  • Hard reseting the branch to commit 24192eb, running pre-commit, and pushing a new commit

For all of the above cases, CI pre-commit yields the same error.

I think this might be some recent changes, and James does not use flake8

This might be enough to cleanup the formatting issue, add spaces around "-"

debug.write(f"up:{monotonic() - self.t0:.1f}\n")

There is the "monotonic() - self.t0", which is bunch up night and tight. But it takes the monotonic timestamp and subtracts a timer variable. It definitely does not feel readable to me.

That said this is not good because monotonic in the circuitpython implementation is not good and significantly loses accuracy in as little as a day. So this needs to be remove.

I guess I was just confused because I never made changes to main_loop.py, but your proposed changes made sense and I was able to fix the issue. Closing the bug now.
Thanks!