Skip to content

comment-loc-cap: script/ is uncounted, and one aggregate lets test subsidise src #402

Description

@thedavidmeister

comment-loc-cap caps comment lines at twice code lines, summed over src test .github. Two properties of that shape mean a repo can be far past the spirit of the cap while passing it comfortably.

One aggregate hides the directory you care about. In st0x.deploy right now:

path comments code ratio
src 5179 5489 0.94
test 6214 17380 0.36
script 1134 1380 0.82

The counted aggregate is 0.50 against a cap of 2.0, so the check reports clean — 259 files. src on its own is near 1:1, and it is diluted below half by test's 17k code lines. A test suite growing is enough to buy headroom for src prose indefinitely, which is backwards: tests are where a high code ratio is normal and src is where the prose actually accumulates.

script/ is not counted at all. The default path set omits it, and a deploy repo's script/ is exactly where unread prose collects — it is run by CI and by one operator, and reviewed least. st0x.deploy's script/cut-release.sh was 28 comment lines against 3 lines of code before I cut it; nothing would ever have flagged that.

A consumer cannot fix either locally. The action takes a paths input, but rainix-sol-static.yaml calls it with no with: and declares no inputs of its own, and rainix-sol.yaml declares none either — so there is no way to pass script through from a consuming repo.

Shapes of a fix

  • Add script to the action's default paths. One line, and it closes the uncounted directory for every consumer at once.
  • Forward a paths input through rainix-sol.yaml → rainix-sol-static.yaml → the action, so a repo with an unusual layout can name its own.
  • Consider a per-path cap rather than one sum, so test cannot subsidise src. The aggregate is what makes a 0.94 src invisible, and a per-directory check would have the same strictness without that.

The first is worth doing regardless of the third.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions