Skip to content

Trim dev-only lint configs from the release archive#3214

Merged
pfefferle merged 1 commit intotrunkfrom
fix/gitattributes-coverage
Apr 22, 2026
Merged

Trim dev-only lint configs from the release archive#3214
pfefferle merged 1 commit intotrunkfrom
fix/gitattributes-coverage

Conversation

@pfefferle
Copy link
Copy Markdown
Member

Fixes a gap in .gitattributes where two tracked dev-only config files were leaking into the WordPress.org release zip, and adds a skill so the audit is easy to repeat.

Proposed changes:

  • Add export-ignore for .stylelintrc.json and eslint.config.cjs (both were being included in git archive output, i.e. shipped to users).
  • Remove stale export-ignore entries for .eslintignore and .eslintrc.js, which no longer exist after the ESLint flat-config migration.
  • Add a new gitattributes skill (.agents/skills/gitattributes/SKILL.md with stub in .claude/skills/) documenting the audit workflow: one-command check, bucket-by-bucket rules, and the --worktree-attributes trick for previewing changes before committing.

Other information:

  • Have you written new tests for your changes, if applicable?

Root cause: the ESLint flat-config migration renamed .eslintrc.jseslint.config.cjs but .gitattributes was not updated. The new skill's red-flag list explicitly calls out this failure mode.

Testing instructions:

  • Check out this branch.
  • Run: git archive --worktree-attributes --format=tar HEAD | tar -t | awk -F/ '{print $1}' | sort -u
  • Verify the output lists ONLY: LICENSE, activitypub.php, assets, build, includes, integration, patterns, readme.txt, templates.
  • Compare against trunk (same command, without --worktree-attributes): that output additionally contains .stylelintrc.json and eslint.config.cjs — confirming the leak this PR fixes.

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch

Type

  • Fixed - for any bug fixes

Message

Trim dev-only configuration files from the plugin release package.

Two tracked files slipped through export-ignore after the ESLint flat-config
migration:

- `.stylelintrc.json`
- `eslint.config.cjs`

Both are now excluded from `git archive`. Also drops stale entries for
`.eslintignore` and `.eslintrc.js`, which no longer exist in the repo.

Adds a `gitattributes` skill that documents the audit workflow so this drift
is easier to catch next time a tool is renamed.
Copilot AI review requested due to automatic review settings April 22, 2026 08:23
@pfefferle pfefferle self-assigned this Apr 22, 2026
@pfefferle pfefferle requested a review from a team April 22, 2026 08:23
@github-actions github-actions Bot added the Docs label Apr 22, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the plugin’s release packaging by updating .gitattributes export-ignore rules so dev-only lint configuration files don’t get included in the WordPress.org release archive, and adds a reusable “gitattributes audit” skill to make future checks repeatable.

Changes:

  • Add export-ignore rules for .stylelintrc.json and eslint.config.cjs, and remove stale ignores for .eslintignore / .eslintrc.js.
  • Add a new .agents skill documenting a repeatable git archive audit workflow (with a .claude stub pointing to it).
  • Add a changelog entry for the packaging fix.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
.github/changelog/fix-gitattributes-coverage Adds a changelog entry describing the packaging fix.
.gitattributes Updates export-ignore coverage to exclude current dev-only lint config files and remove stale entries.
.claude/skills/gitattributes/SKILL.md Adds the .claude skill stub pointing to the full .agents instructions.
.agents/skills/gitattributes/SKILL.md Documents the audit workflow to verify release archive contents and keep .gitattributes current.

Comment on lines +14 to +22
## Quick Audit (one command)

```bash
# Entries in the release archive at the repository root
git archive --format=tar HEAD | tar -t | awk -F/ '{print $1}' | sort -u

# Same, but uses the working-tree .gitattributes (use while iterating on edits)
git archive --worktree-attributes --format=tar HEAD | tar -t | awk -F/ '{print $1}' | sort -u
```
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The section title says “Quick Audit (one command)”, but the block includes two variants (committed attributes vs --worktree-attributes). Consider renaming this heading to something like “Quick Audit (one-liner)” or “Quick Audit (commands)” to match the content.

Copilot uses AI. Check for mistakes.
@pfefferle pfefferle merged commit b889d6a into trunk Apr 22, 2026
9 checks passed
@pfefferle pfefferle deleted the fix/gitattributes-coverage branch April 22, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants