gitattributes

द्वारा automattic

.gitattributes export-ignore कवरेज का ऑडिट या अपडेट करते समय उपयोग करें, ताकि केवल-डेव फ़ाइलें (lint कॉन्फ़िग, CI, टेस्ट, डॉक्स, बिल्ड टूलिंग) रिलीज़ में न भेजी जाएँ...

npx skills add https://github.com/automattic/wordpress-activitypub --skill gitattributes

.gitattributes Export-Ignore Audit

Ensure the WordPress.org release archive (git archive output) contains only runtime files. Dev tooling, tests, CI, and repo meta must be export-ignored.

Why This Matters

The WordPress.org zip is built via git archive. Anything without export-ignore ends up on every user's site, bloating the install and shipping dev-only code. Equally bad: stale export-ignore entries for files that no longer exist look tidy but protect nothing.

Quick Audit (one command)

# 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

git archive HEAD reads .gitattributes from the commit, so uncommitted fixes won't show up. Use --worktree-attributes to preview a pending change before committing.

The output should contain ONLY runtime artifacts. For this plugin that's: LICENSE, readme.txt, activitypub.php, assets, build, includes, integration, patterns, templates.

Anything else in the list is a gap — add an export-ignore rule.

Cross-Check Tracked vs Ignored

# Top-level tracked entries
git ls-tree --name-only HEAD | sort > /tmp/tracked.txt

# Entries referenced in .gitattributes
grep export-ignore .gitattributes | awk '{print $1}' | sed 's|^/||; s|/$||' | sort > /tmp/ignored.txt

# Stale entries (in .gitattributes but no longer tracked)
comm -23 /tmp/ignored.txt /tmp/tracked.txt

Stale entries aren't dangerous, but they rot and mislead future readers. Delete them.

What Belongs in Each Bucket

CategoryExamplesRule
Runtime PHPactivitypub.php, includes/, integration/keep
Runtime assetsassets/, build/, patterns/, templates/keep
WordPress.org metareadme.txt, LICENSEkeep
Dev dotfiles.editorconfig, .prettierrc.js, .stylelintrc.json, eslint.config.cjs, .wp-env.jsonexport-ignore
Repo meta.github/, .githooks/, .gitignore, .gitattributes, .wordpress-org/export-ignore
Agent/AI tooling.agents/, .claude/, AGENTS.md, CLAUDE.mdexport-ignore
Build & package configspackage.json, package-lock.json, composer.json, webpack.config.js, tsconfig.json, jest.config.js, jest.setup.jsexport-ignore
QA configsphpcs.xml, phpunit.xml.distexport-ignore
Source (pre-build)src/export-ignore (shipping build/ instead)
Teststests/export-ignore
Docs for contributorsdocs/, snippets/, CHANGELOG.md, CODE_OF_CONDUCT.md, CONTRIBUTING.md, FEDERATION.md, README.md, SECURITY.mdexport-ignore
Scriptsbin/, local/export-ignore

When to Run This Audit

  • Before tagging a release.
  • After adding or renaming any top-level file, dotfile, or config.
  • After adopting a new dev tool (lint, test runner, bundler).
  • When a linter flat-config migration renames files (e.g. .eslintrc.jseslint.config.cjs).

Writing Rules

  • Use a leading / to anchor to the repo root: /phpcs.xml, not phpcs.xml.
  • Use a trailing / for directories: /tests/.
  • Keep grouping comments tidy (dotfiles, build configs, source/tests, docs, linguist).

Linguist Attributes (bonus)

Also used in .gitattributes to shape GitHub's language stats:

  • /build/** linguist-generated — hides machine-built output.
  • /docs/** linguist-documentation — keeps docs out of the language bar.
  • /package-lock.json linguist-generated — hides lockfile churn.

These don't affect the archive, but live in the same file, so keep them current too.

Red Flags

  • Release zip is larger than expected → something new is leaking in.
  • New dev dependency added, .gitattributes untouched → likely a gap.
  • Lint tool migrated to a new config filename → old entry is stale, new file is leaking.
  • Top-level file renamed → old export-ignore is dead weight, new one is missing.

automattic की और Skills

wp-phpstan
automattic
वर्डप्रेस प्रोजेक्ट्स (प्लगइन्स/थीम्स/साइट्स) में PHPStan स्टैटिक एनालिसिस को कॉन्फ़िगर करने, चलाने या ठीक करने के लिए उपयोग करें: phpstan.neon सेटअप, बेसलाइन्स,…
official
wp-playground
automattic
वर्डप्रेस प्लेग्राउंड वर्कफ़्लो के लिए उपयोग करें: ब्राउज़र में या स्थानीय रूप से @wp-playground/cli (सर्वर, रन-ब्लूप्रिंट, बिल्ड-स्नैपशॉट) के माध्यम से तेज़ डिस्पोज़ेबल WP इंस्टेंस,…
official
wp-plugin-development
automattic
वर्डप्रेस प्लगइन विकसित करते समय उपयोग करें: आर्किटेक्चर और हुक्स, सक्रियण/निष्क्रियण/अनइंस्टॉल, एडमिन यूआई और सेटिंग्स एपीआई, डेटा स्टोरेज, क्रॉन/कार्य, सुरक्षा…
official
wp-project-triage
automattic
जब आपको किसी वर्डप्रेस रिपॉजिटरी (प्लगइन/थीम/ब्लॉक थीम/WP कोर/गुटेनबर्ग/पूर्ण साइट) का निर्धारित निरीक्षण चाहिए, जिसमें टूलिंग/टेस्ट/संस्करण… शामिल हों।
official
wp-rest-api
automattic
वर्डप्रेस REST API एंडपॉइंट/रूट्स बनाने, विस्तारित करने या डीबग करने के लिए उपयोग करें: register_rest_route, WP_REST_Controller/कंट्रोलर क्लासेस, स्कीमा/आर्गुमेंट…
official
wp-wpcli-and-ops
automattic
WP-CLI (wp) के साथ WordPress संचालन के लिए उपयोग करें: सुरक्षित खोज-बदलाव, db निर्यात/आयात, प्लगइन/थीम/उपयोगकर्ता/सामग्री प्रबंधन, क्रॉन, कैश फ्लशिंग,…
official
wpds
automattic
जब वर्डप्रेस डिज़ाइन सिस्टम (WPDS) और इसके घटकों, टोकन, पैटर्न आदि का उपयोग करके यूआई बनाया जा रहा हो, तब उपयोग करें।
official
woocommerce-finalize
automattic
WooCommerce प्लगइन्स के लिए प्री-रिलीज़ कोड स्वास्थ्य और ट्रेसेबिलिटी ऑडिट। कोड समीक्षा के बाद चलता है -- मृत कोड, डुप्लिकेशन, संरचनात्मक जटिलता, और… पर ध्यान केंद्रित करता है।
official