Answer prose round 1: 0 🔴, 5 🟡 (0 misread); say what the check counts and what a setting does, and tighten the docstrings and comments
CI / tests (pull_request) Has been cancelled
CI / tests (pull_request) Has been cancelled
This commit is contained in:
@@ -76,5 +76,5 @@ class Gathered:
|
||||
merges_unread: Failure | None = None
|
||||
# The worktrees `chunk-pr clean` is still to remove.
|
||||
left: tuple[LeftWorktree, ...] = ()
|
||||
# The line counts of the project's code where it is space-indented with no setting that says so, or why they cannot be read; None where it is not.
|
||||
# The line counts of the project's code where it is space-indented and no setting sets the indent, or why they cannot be read; None where it is not.
|
||||
indentation: SpaceIndented | Failure | None = None
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Whether a project's code is space-indented with no tool setting that says so.
|
||||
"""Whether a project's code is space-indented where no tool setting sets the indent.
|
||||
|
||||
The technical principles indent with hard tabs by default, and let a setting a tool reads override that. Code that is mostly space-indented, with no such setting, reads as a first session's habit that later sessions followed, not as a choice."""
|
||||
import dataclasses
|
||||
@@ -9,11 +9,11 @@ import re
|
||||
from failure import Failure
|
||||
from git_cli.git_repo import git
|
||||
|
||||
# The files the project's language tooling covers. Markdown, JSON and YAML are not code: their indentation is a format's.
|
||||
# Files of common programming languages, by extension. Markdown, JSON and YAML aren't code: a format fixes their indentation.
|
||||
CODE = re.compile(r".*\.(py|js|mjs|cjs|jsx|ts|tsx|rs|go|php|java|kt|kts|scala|rb|c|h|cc|cpp|hpp|cs|swift|sh|bash|lua|ex|exs|dart|vue|svelte)", re.IGNORECASE)
|
||||
# Committed copies of other people's code follow their authors' style.
|
||||
VENDORED = re.compile(r"(^|/)(vendor|node_modules|third_party)/")
|
||||
# The files whose key says how to indent: an `.editorconfig` with `indent_style`, rustfmt's `hard_tabs`, Prettier's `useTabs` in its own files or a `package.json`, Biome's `indentStyle`.
|
||||
# The key that, present in a file of that name, means the project sets its indent, whatever the key's value. Prettier also reads `package.json`.
|
||||
SETTINGS = (
|
||||
(re.compile(r"\.editorconfig"), "indent_style"),
|
||||
(re.compile(r"\.?rustfmt\.toml"), "hard_tabs"),
|
||||
@@ -33,7 +33,7 @@ class SpaceIndented:
|
||||
|
||||
|
||||
def space_indented(base: pathlib.Path, timeout: float | None = None) -> SpaceIndented | Failure | None:
|
||||
"""The line counts of the tracked code under base where it has more space-indented lines than tab-indented ones and no tracked file sets the indent; None where it doesn't, or has no code; a Failure where a file cannot be read."""
|
||||
"""The line counts of the tracked code under base, where it has more space-indented than tab-indented lines and no tracked file holds an indent key; else None. A Failure where git cannot list the files or a file cannot be read."""
|
||||
tracked = git("ls-files", "-z", cwd=str(base), timeout=timeout, errors="replace")
|
||||
if isinstance(tracked, Failure):
|
||||
return tracked
|
||||
|
||||
@@ -21,11 +21,12 @@ and prints that the release reviews and the cuts are the human's to call. It pri
|
||||
finished on the branch of an open pull request that is not a draft, where the checkout holds
|
||||
the plan. Where no item of the release can start and one awaits such a merge, it names those
|
||||
pull requests and says the working loop stops there;
|
||||
- where the project's tracked code (the files its language tooling covers, not Markdown, JSON or
|
||||
YAML) has more space-indented than tab-indented lines, and neither an `.editorconfig` with
|
||||
`indent_style` nor a formatter setting (`rustfmt.toml` `hard_tabs`, Prettier `useTabs`, Biome
|
||||
`indentStyle`) says so, one line naming the technical principles' hard-tabs default and the two
|
||||
ways out. It only reports;
|
||||
- where the project's tracked code (files of common programming languages, by extension; not
|
||||
Markdown, JSON or YAML, nor anything under vendor/, node_modules/ or third_party/) has more
|
||||
space-indented than tab-indented lines, and neither an `.editorconfig` with `indent_style` nor a
|
||||
formatter setting (`rustfmt.toml` `hard_tabs`, Prettier `useTabs`, Biome `indentStyle`) sets the
|
||||
indent, one line naming the technical principles' hard-tabs default and the two ways out. It
|
||||
reports only, and never fails the run;
|
||||
- the next release and its first item that does not wait, the item loop-claude routes on, with its L
|
||||
and E + I; with --item <ID>, the plan item of that ID instead, which loop-claude names in a window
|
||||
named for an item. An item waits while it is marked question, while an item still in todo.md
|
||||
|
||||
Reference in New Issue
Block a user