{"id":30827476,"url":"https://github.com/builtnorth/coding-standards","last_synced_at":"2026-01-20T17:35:11.416Z","repository":{"id":309401658,"uuid":"1036098457","full_name":"builtnorth/coding-standards","owner":"builtnorth","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-30T18:11:55.000Z","size":3367,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-30T20:23:21.893Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/builtnorth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-11T14:55:21.000Z","updated_at":"2025-08-11T16:50:04.000Z","dependencies_parsed_at":"2025-08-11T18:38:09.685Z","dependency_job_id":"7b8dae26-e8f8-4aab-be68-5cd220fa4f1b","html_url":"https://github.com/builtnorth/coding-standards","commit_stats":null,"previous_names":["builtnorth/coding-standards"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/builtnorth/coding-standards","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/builtnorth%2Fcoding-standards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/builtnorth%2Fcoding-standards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/builtnorth%2Fcoding-standards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/builtnorth%2Fcoding-standards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/builtnorth","download_url":"https://codeload.github.com/builtnorth/coding-standards/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/builtnorth%2Fcoding-standards/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273908581,"owners_count":25189162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-06T13:12:54.427Z","updated_at":"2026-01-20T17:35:11.379Z","avatar_url":"https://github.com/builtnorth.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Built North Coding Standards\n\nWordPress coding standards for Built North projects, extending WPCS with modern PHP practices.\n\n## Overview\n\nThis package provides a consistent set of coding standards for all Built North WordPress projects. It extends the WordPress Coding Standards (WPCS) while allowing modern PHP features and PSR-4 autoloading.\n\n## Installation\n\nAdd to your project via Composer:\n\n```bash\ncomposer require --dev builtnorth/coding-standards\n```\n\n## Usage\n\n### Basic Usage\n\nCreate a `phpcs.xml` file in your project root:\n\n```xml\n\u003c?xml version=\"1.0\"?\u003e\n\u003cruleset name=\"My Project\"\u003e\n    \u003cdescription\u003eCoding standards for my project\u003c/description\u003e\n    \n    \u003c!-- Use Built North standards --\u003e\n    \u003crule ref=\"BuiltNorth\"/\u003e\n    \n    \u003c!-- Project-specific text domain --\u003e\n    \u003crule ref=\"WordPress.WP.I18n\"\u003e\n        \u003cproperties\u003e\n            \u003cproperty name=\"text_domain\" type=\"array\"\u003e\n                \u003celement value=\"my-text-domain\"/\u003e\n            \u003c/property\u003e\n        \u003c/properties\u003e\n    \u003c/rule\u003e\n\u003c/ruleset\u003e\n```\n\n### Running the Standards\n\n```bash\n# Check your code\nvendor/bin/phpcs\n\n# Fix auto-fixable issues\nvendor/bin/phpcbf\n\n# Check specific file or directory\nvendor/bin/phpcs src/\n\n# Check with specific standard\nvendor/bin/phpcs --standard=BuiltNorth\n```\n\n## What's Included\n\n### Base Standards\n- WordPress Coding Standards (WPCS) 3.0+\n- PHP Compatibility checks for PHP 8.1+\n- PSR-1/PSR-2 file structure rules\n\n### Modern PHP Features Allowed\n- ✅ Short array syntax `[]`\n- ✅ Short ternary operator `?:`\n- ✅ Namespaces and PSR-4 autoloading\n- ✅ Modern PHP 8.1+ features\n\n### Excluded WordPress Rules\n- File naming conventions (we use PSR-4)\n- Yoda conditions requirement\n- File comment requirements\n- Overly strict comment punctuation\n\n### File Exclusions\nAutomatically excludes from scanning:\n- `/vendor/`\n- `/node_modules/`\n- `/build/` and `/dist/`\n- `*.min.js` and `*.min.css`\n- WordPress core files\n- Test bootstrap files\n\n## Customization\n\n### Adding Project-Specific Rules\n\nYour project's `phpcs.xml` can add additional rules:\n\n```xml\n\u003crule ref=\"BuiltNorth\"/\u003e\n\n\u003c!-- Add project-specific rules --\u003e\n\u003crule ref=\"WordPress.WP.EnqueuedResourceParameters\"/\u003e\n\n\u003c!-- Or exclude specific rules --\u003e\n\u003crule ref=\"BuiltNorth\"\u003e\n    \u003cexclude name=\"WordPress.NamingConventions.PrefixAllGlobals\"/\u003e\n\u003c/rule\u003e\n```\n\n### Setting Prefixes for Global Functions\n\n```xml\n\u003crule ref=\"WordPress.NamingConventions.PrefixAllGlobals\"\u003e\n    \u003cproperties\u003e\n        \u003cproperty name=\"prefixes\" type=\"array\"\u003e\n            \u003celement value=\"my_prefix\"/\u003e\n            \u003celement value=\"MyNamespace\"/\u003e\n        \u003c/property\u003e\n    \u003c/properties\u003e\n\u003c/rule\u003e\n```\n\n## Integration with CI/CD\n\n### GitHub Actions Example\n\n```yaml\n- name: Install dependencies\n  run: composer install\n\n- name: Run PHPCS\n  run: vendor/bin/phpcs --report=checkstyle | cs2pr\n```\n\n### Pre-commit Hook\n\nAdd to `.git/hooks/pre-commit`:\n\n```bash\n#!/bin/bash\nvendor/bin/phpcs --filter=GitStaged\n```\n\n## Philosophy\n\nOur coding standards aim to:\n\n1. **Embrace Modern PHP**: Use PHP 8.1+ features while maintaining WordPress compatibility\n2. **Prioritize Readability**: Code should be self-documenting with clear naming\n3. **Support PSR-4**: Use modern autoloading instead of WordPress file naming\n4. **Balance Strictness**: Enforce important standards without being pedantic\n5. **Enable Consistency**: Same standards across all Built North projects\n\n## Requirements\n\n- PHP \u003e= 8.1\n- Composer\n- WordPress project (for context-aware rules)\n\n## Contributing\n\nTo contribute to these standards:\n\n1. Clone the repository\n2. Make your changes to `BuiltNorth/ruleset.xml`\n3. Test with real projects\n4. Submit a pull request with reasoning for changes\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuiltnorth%2Fcoding-standards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuiltnorth%2Fcoding-standards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuiltnorth%2Fcoding-standards/lists"}