Skip to content

chore: review fix/agents guidance import lint#1285

Open
crowecawcaw wants to merge 2 commits into
aws-deadline:mainlinefrom
crowecawcaw:review-fix/agents-guidance-import-lint
Open

chore: review fix/agents guidance import lint#1285
crowecawcaw wants to merge 2 commits into
aws-deadline:mainlinefrom
crowecawcaw:review-fix/agents-guidance-import-lint

Conversation

@crowecawcaw

@crowecawcaw crowecawcaw commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What was the problem/requirement? (What/Why)

Agents in this codebase often put imports in functions and write long verbose comments.

What was the solution? (How)

Add a linter for imports not at the top of the file
Add AGENTS.md guidance about comments

What is the impact of this change?

Agents produce better code with less feedback.

How was this change tested?

CI

Was this change documented?

n/a

Does this PR introduce new dependencies?

No

Is this a breaking change?

No

Does this change impact security?

No

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Testing

Manually verified the new lint config locally (ruff 0.15.22 via hatch run lint, macOS):

  1. Rules actually fire: created a scratch file with a module-level import after executable code (no noqa) and an unsorted __all__. hatch run ruff check flagged both — E402 Module level import not at top of file and RUF022 `__all__` is not sorted — and exited non-zero.
  2. Escape hatch works: adding # noqa: E402 to the late import made the file pass, matching the existing suppressions in the tree (e.g. src/deadline/client/cli/_common.py, test/ui/conftest.py, test/blender_submitter_ui/* — deferred/bpy-gated imports).
  3. No spurious hits on the real tree: after removing the scratch file, hatch run lint passes clean on the full repo (ruff check . — all checks passed; ruff format --check — 328 files already formatted; mypy — no issues in 311 files).

Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
@github-actions github-actions Bot added the waiting-on-maintainers Waiting on the maintainers to review. label Jul 21, 2026
@crowecawcaw crowecawcaw changed the title Review fix/agents guidance import lint chore: review fix/agents guidance import lint Jul 21, 2026
@crowecawcaw
crowecawcaw marked this pull request as ready for review July 21, 2026 22:55
@crowecawcaw
crowecawcaw requested a review from a team as a code owner July 21, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on-maintainers Waiting on the maintainers to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant