PHPackages                             builtnorth/coding-standards - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. builtnorth/coding-standards

ActivePhpcodesniffer-standard[Utility &amp; Helpers](/categories/utility)

builtnorth/coding-standards
===========================

Built North coding standards for WordPress projects, extending WPCS with modern PHP practices

1.0.0(10mo ago)02.0k[1 issues](https://github.com/builtnorth/coding-standards/issues)6MITPHP &gt;=8.1CI passing

Since Aug 11Pushed 10mo agoCompare

[ Source](https://github.com/builtnorth/coding-standards)[ Packagist](https://packagist.org/packages/builtnorth/coding-standards)[ RSS](/packages/builtnorth-coding-standards/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (6)

Built North Coding Standards
============================

[](#built-north-coding-standards)

WordPress coding standards for Built North projects, extending WPCS with modern PHP practices.

Overview
--------

[](#overview)

This 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.

Installation
------------

[](#installation)

Add to your project via Composer:

```
composer require --dev builtnorth/coding-standards
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

Create a `phpcs.xml` file in your project root:

```

    Coding standards for my project

```

### Running the Standards

[](#running-the-standards)

```
# Check your code
vendor/bin/phpcs

# Fix auto-fixable issues
vendor/bin/phpcbf

# Check specific file or directory
vendor/bin/phpcs src/

# Check with specific standard
vendor/bin/phpcs --standard=BuiltNorth
```

What's Included
---------------

[](#whats-included)

### Base Standards

[](#base-standards)

- WordPress Coding Standards (WPCS) 3.0+
- PHP Compatibility checks for PHP 8.1+
- PSR-1/PSR-2 file structure rules

### Modern PHP Features Allowed

[](#modern-php-features-allowed)

- ✅ Short array syntax `[]`
- ✅ Short ternary operator `?:`
- ✅ Namespaces and PSR-4 autoloading
- ✅ Modern PHP 8.1+ features

### Excluded WordPress Rules

[](#excluded-wordpress-rules)

- File naming conventions (we use PSR-4)
- Yoda conditions requirement
- File comment requirements
- Overly strict comment punctuation

### File Exclusions

[](#file-exclusions)

Automatically excludes from scanning:

- `/vendor/`
- `/node_modules/`
- `/build/` and `/dist/`
- `*.min.js` and `*.min.css`
- WordPress core files
- Test bootstrap files

Customization
-------------

[](#customization)

### Adding Project-Specific Rules

[](#adding-project-specific-rules)

Your project's `phpcs.xml` can add additional rules:

```

```

### Setting Prefixes for Global Functions

[](#setting-prefixes-for-global-functions)

```

```

Integration with CI/CD
----------------------

[](#integration-with-cicd)

### GitHub Actions Example

[](#github-actions-example)

```
- name: Install dependencies
  run: composer install

- name: Run PHPCS
  run: vendor/bin/phpcs --report=checkstyle | cs2pr
```

### Pre-commit Hook

[](#pre-commit-hook)

Add to `.git/hooks/pre-commit`:

```
#!/bin/bash
vendor/bin/phpcs --filter=GitStaged
```

Philosophy
----------

[](#philosophy)

Our coding standards aim to:

1. **Embrace Modern PHP**: Use PHP 8.1+ features while maintaining WordPress compatibility
2. **Prioritize Readability**: Code should be self-documenting with clear naming
3. **Support PSR-4**: Use modern autoloading instead of WordPress file naming
4. **Balance Strictness**: Enforce important standards without being pedantic
5. **Enable Consistency**: Same standards across all Built North projects

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Composer
- WordPress project (for context-aware rules)

Contributing
------------

[](#contributing)

To contribute to these standards:

1. Clone the repository
2. Make your changes to `BuiltNorth/ruleset.xml`
3. Test with real projects
4. Submit a pull request with reasoning for changes

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance54

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

326d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4ea760d2fc869dfda680e0bd6dce422606e91d6a1687938a8ebc38a0c29ca343?d=identicon)[dannorthern](/maintainers/dannorthern)

---

Top Contributors

[![dannorthern](https://avatars.githubusercontent.com/u/157666970?v=4)](https://github.com/dannorthern "dannorthern (3 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/builtnorth-coding-standards/health.svg)

```
[![Health](https://phpackages.com/badges/builtnorth-coding-standards/health.svg)](https://phpackages.com/packages/builtnorth-coding-standards)
```

###  Alternatives

[humanmade/coding-standards

Human Made Coding Standards

160443.1k59](/packages/humanmade-coding-standards)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.1M142](/packages/wp-cli-wp-cli-tests)[slevomat/coding-standard

Slevomat Coding Standard for PHP\_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.

1.5k134.0M2.3k](/packages/slevomat-coding-standard)[mediawiki/mediawiki-codesniffer

MediaWiki CodeSniffer Standards

343.2M444](/packages/mediawiki-mediawiki-codesniffer)[ec-europa/toolkit

Toolkit packaged for Drupal projects based on Robo.

40252.8k34](/packages/ec-europa-toolkit)[syde/phpcs

Syde PHP coding standards for WordPress projects.

1027.6k9](/packages/syde-phpcs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
