Skip to content

Make CI pass: fix .flake8 and the 99 hard lint errors it was hiding - #18

Merged
CrazyDubya merged 2 commits into
mainfrom
claude/problem-solving-movie-x67tec
Sep 20, 2026
Merged

CrazyDubya merged 2 commits into
mainfrom
claude/problem-solving-movie-x67tec

Conversation

@CrazyDubya

Copy link
Copy Markdown
Owner

What this is

The cleanup PR. The build workflow has failed on every recorded run of main because the root .flake8 puts inline # comments inside multi-line option values, which flake8 ≥ 5 rejects before linting a single file. With the config fixed, the workflow's strict step (--select=E9,F63,F7,F82) reports 99 pre-existing hard errors in 24 files; and once lint passes, the root pytest step has one failing test. This PR fixes all of it.

Changes

  • .flake8: comments moved out of option values; import-order-style dropped (that plugin isn't installed).
  • Two syntax errors: an unterminated string in iPhone toss to Mac/autopy.py and an if __name__ == '__main__': with no body at the end of hive-mind/Z/zhive-mind.py.
  • Missing imports (os, re, sys, shutil, subprocess, requests, anthropic, tkinter) in 19 files. Inserted at the top of each file's import block; no other changes to those files.
  • Real bugs the linter surfaced:
    • nomic/nomic.py: used response.content where the variable is response_content.
    • inner_monologue/inn_mono_gui.py: referenced its nested QuestionDialog class without self..
    • bookmaker/ and brainstorm/harmonized_api_wrappers.py: called an undefined MonsterAPI(...); the module imports client from monsterapi, so it now uses that.
    • 4x/colony_management.py: subclassed four base classes (Infrastructure, Colonist, EnvironmentalHazard, DefensePlatform) that were never defined, and DefenseSystem.update read a free variable threats. Minimal base classes added; threats is now a parameter with an empty default (the existing update(1) call still works).
    • 4x/tech_tree.py: demo code at module level used an undefined game_state; defined as {} (the function it feeds is a pass stub).
  • shared_utils.setup_logging: logging.basicConfig is a no-op once the root logger already has handlers, which is the case under pytest, so the named logger stayed at WARNING and its file handler never wrote anything. Setting the logger's level explicitly fixes test_setup_logging_with_file, the one failing root test.

Testing (every CI step, run locally with the repo's own config)

flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics   -> 0
pytest                                                                -> 19 passed
pytest langtons_highway/tests -o addopts=""                          -> 8 passed

The warnings-only step (--exit-zero) reports 420 style warnings; it cannot fail the build and was left alone.

Scope note

I changed as little as possible per file: imports, one-line bug fixes, and stub base classes. I did not touch the 420 style warnings, the 44 Dependabot alerts on requirements.txt, or the projects' behaviour beyond what the undefined names required. Those are separate work if wanted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F


Generated by Claude Code

The root .flake8 put inline comments inside multi-line option values,
which flake8 >= 5 rejects, so the workflow's first lint step has crashed
on every run since it was added. With the config fixed, the strict step
(E9,F63,F7,F82) reported 99 pre-existing errors in 24 files. This commit
fixes the config and all of them:

- .flake8: comments moved out of option values; import-order-style
  dropped (plugin not installed).
- Two syntax errors: an unterminated string in autopy.py and an empty
  `if __name__ == '__main__':` block in zhive-mind.py.
- Missing imports (os, re, sys, shutil, subprocess, requests, anthropic,
  tkinter) in 19 files.
- Real bugs: nomic.py used `response.content` for a variable named
  `response_content`; inn_mono_gui.py referenced its nested
  QuestionDialog class without `self.`; both harmonized_api_wrappers.py
  called an undefined `MonsterAPI` instead of the imported `client`;
  4x/colony_management.py subclassed four never-defined base classes and
  read a free variable `threats` (now a parameter with an empty default);
  4x/tech_tree.py's demo code used an undefined `game_state`.
- shared_utils.setup_logging: basicConfig is a no-op once the root logger
  has handlers (as under pytest), leaving the named logger at WARNING and
  the file handler silent; set the logger level explicitly. This fixes
  the one failing root test.

Locally: `flake8 . --select=E9,F63,F7,F82` -> 0; root `pytest` -> 19
passed; `pytest langtons_highway/tests` -> 8 passed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
@CrazyDubya
CrazyDubya marked this pull request as ready for review September 20, 2026 14:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94b7579b8d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread nomic/nomic.py
make_api_call returned response.content, which the Anthropic Messages
API delivers as a list of content blocks rather than a string. Both
consumers then failed on the first turn: `history += response_content`
raised TypeError (str + list), and update_game_state's re.findall could
not parse a list. Return response.content[0].text instead, matching the
six other Anthropic call sites in this repository.

Reported by the Codex review bot on #18.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DVvB1dWEhjyBKh95Zojt3F
@CrazyDubya
CrazyDubya merged commit 305f763 into main Sep 20, 2026
1 check passed
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