Skip to content

chore(scripts): share the commitlint install block between the two scripts #93

Description

@martinfrancois

Problem

scripts/install_commitlint.sh and scripts/commitlint_release_pr.sh carry the same install block verbatim: create a scratch directory, write {"private":true} as package.json, copy commitlint.config.cjs, run the package-manager install with the two pinned commitlint packages. The pnpm migration edited both in lockstep, and Renovate's custom manager has to match both files. The next change to how commitlint is installed is a two-file edit again.

Found by the code review of the pnpm migration PR; out of that PR's scope.

Proposed fix

Move the install block into one sourced helper (for example scripts/lib/commitlint_install.sh exposing install_commitlint <dir>), call it from both scripts, and narrow the Renovate managerFilePatterns for the commitlint pins to the helper. Keep the exported COMMITLINT_BIN and COMMITLINT_CONFIG contract unchanged so the workflows do not move. Run bash -n, both workflows on a pull request, and scripts/test_read_release_pr_output.sh where it exists.

Apply the same change in java-streams-skill, java-optionals-skill, and java-functional-style-skill so the three scaffolds stay identical.

AI Assistance (if used)

  • AI-assisted issue
  • I confirm I understand and reviewed this request

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions