Repository navigation
Make CI pass: fix .flake8 and the 99 hard lint errors it was hiding - #18
Merged
Merged
Conversation
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
marked this pull request as ready for review
September 20, 2026 14:13
There was a problem hiding this comment.
💡 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".
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
The cleanup PR. The
buildworkflow has failed on every recorded run ofmainbecause the root.flake8puts 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 rootpyteststep has one failing test. This PR fixes all of it.Changes
.flake8: comments moved out of option values;import-order-styledropped (that plugin isn't installed).iPhone toss to Mac/autopy.pyand anif __name__ == '__main__':with no body at the end ofhive-mind/Z/zhive-mind.py.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.nomic/nomic.py: usedresponse.contentwhere the variable isresponse_content.inner_monologue/inn_mono_gui.py: referenced its nestedQuestionDialogclass withoutself..bookmaker/andbrainstorm/harmonized_api_wrappers.py: called an undefinedMonsterAPI(...); the module importsclientfrommonsterapi, so it now uses that.4x/colony_management.py: subclassed four base classes (Infrastructure,Colonist,EnvironmentalHazard,DefensePlatform) that were never defined, andDefenseSystem.updateread a free variablethreats. Minimal base classes added;threatsis now a parameter with an empty default (the existingupdate(1)call still works).4x/tech_tree.py: demo code at module level used an undefinedgame_state; defined as{}(the function it feeds is apassstub).shared_utils.setup_logging:logging.basicConfigis 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 fixestest_setup_logging_with_file, the one failing root test.Testing (every CI step, run locally with the repo's own config)
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