2017 © Pedro Peláez
 

phpcodesniffer-standard ti-wpcs

PHP CodeSniffer rules for Thoughts & Ideas WordPress projects

image

thoughtsideas/ti-wpcs

PHP CodeSniffer rules for Thoughts & Ideas WordPress projects

  • Tuesday, September 12, 2017
  • by thoughtsideas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 513 Installations
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 3 % Grown

The README.md

Thoughts & Ideas WordPress Coding Standards

⚠️ Archived: 2021-07-09 ⚠️, (*1)

license GitHub release Packagist Packagist GitHub issues Libraries.io for GitHub, (*2)

Thoughts & Ideas WordPress Coding Standards (TI-WPCS) is a development dependency for testing coding styles and quality in our WordPress PHP projects. Keeping the code base consistent and highlighting potential issues before they enter our products helps developers pickup our projects and improve their reliability in production., (*3)

Installation

Thoughts & Ideas recommend installing this dependancy via Composer., (*4)

As a Composer Dependancy

To include these standards as part of a project. Require this repository as a development dependancy:, (*5)

composer require --dev thoughtsideas/ti-wpcs

The fixer and tests can be run from the command line:, (*6)

./vendor/bin/phpcbf ./
./vendor/bin/phpcs ./
./vendor/bin/phpmd ./ text ./vendor/thoughtsideas/ti-wpcs/ti-wpmd/ruleset.xml

Automatically run tests before every Git commit.

Thoughts & Ideas recommend a pre-commit Git Hook., (*7)

Create the pre-commit hook file:, (*8)

mkdir ./_scripts && touch ./_scripts/pre-commit

Add the pre-commit hook to our new file:, (*9)

#!/bin/sh
#
# Pre Commit Hook.

# Remove un-staged changes.
git stash -q --keep-index

# Run QA script.
echo "Running WordPress PHP Coding Standards test"
composer run test-phpcbf
composer run test-phpcs
# PHPCS Results (bool)
QA_PHPCS=$?

echo "Running WordPress PHP Mess Detector test"
composer run test-phpmd
# PHPMD Results (bool)
QA_PHPMD=$?

# Apply un-staged changes.
git stash pop -q

# Get our test QA results.
[ $QA_PHPCS -ne 0 ] && exit 1
[ $QA_PHPMD -ne 0 ] && exit 1

# If test pass exit successfully.
exit 0

Link our new file to our git repository, (*10)

ln -s ../../_scripts/pre-commit ./.git/hooks/pre-commit

Every time you commit to your Git repository the TI-WPCS test will run automatically., (*11)

Reporting Issues

If you spot any issues please create a ticket via GitHub's Issue Tracker. Including the issue, the browser and operating system, and how to replicate it. If the issue is security related please use the contact information below., (*12)

Contact

Thoughts & Ideas - hello@thoughtsideas.uk, (*13)

License

This project is licensed under the terms of the MIT license. See the LICENSE file., (*14)

Unless otherwise stated © Thoughts & Ideas. All rights reserved., (*15)

The Versions

12/09 2017

dev-feature/add-security-checker

dev-feature/add-security-checker

PHP CodeSniffer rules for Thoughts & Ideas WordPress projects

  Sources   Download

MIT

The Requires

 

wordpress phpcs phpmd standards

12/09 2017

dev-0012/add-phpcpd

dev-0012/add-phpcpd

PHP CodeSniffer rules for Thoughts & Ideas WordPress projects

  Sources   Download

MIT

The Requires

 

wordpress phpcs phpmd standards

12/09 2017

dev-issue-0008/wpcs-default-settings

dev-issue-0008/wpcs-default-settings

PHP CodeSniffer rules for Thoughts & Ideas WordPress projects

  Sources   Download

MIT

The Requires

 

wordpress phpcs phpmd standards

09/08 2017

dev-master

9999999-dev

PHP CodeSniffer rules for Thoughts & Ideas WordPress projects

  Sources   Download

MIT

The Requires

 

wordpress phpcs phpmd standards

09/08 2017
09/08 2017
09/08 2017

dev-release/1.2.0

dev-release/1.2.0

PHP CodeSniffer rules for Thoughts & Ideas WordPress projects

  Sources   Download

MIT

The Requires

 

wordpress phpcs phpmd standards

09/08 2017

dev-feature/update-phpcs

dev-feature/update-phpcs

PHP CodeSniffer rules for Thoughts & Ideas WordPress projects

  Sources   Download

MIT

The Requires

 

wordpress phpcs phpmd standards

17/05 2017

1.0.0

1.0.0.0

PHP CodeSniffer rules for Thoughts & Ideas WordPress projects

  Sources   Download

MIT

The Requires

 

wordpress phpcs phpmd standards

23/03 2017

dev-php-5.6+

dev-php-5.6+

PHP CodeSniffer rules for Thoughts & Ideas WordPress projects

  Sources   Download

The Requires

 

wordpress phpcs phpmd standards

05/03 2017

dev-documentation

dev-documentation

PHP CodeSniffer rules for Thoughts & Ideas WordPress projects

  Sources   Download

The Requires

 

wordpress phpcs phpmd standards