All Projects → consistence → coding-standard

consistence / coding-standard

Licence: other
Consistence - Coding Standard - PHP Code Sniffer rules

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to coding-standard

php-codesniffer-sniffs
Custom sniffs for PHP_CodeSniffer
Stars: ✭ 16 (-78.08%)
Mutual labels:  coding-standards, php-codesniffer
sniff
Simpler PHP code sniffer built on top of PHP-CS-Fixer.
Stars: ✭ 14 (-80.82%)
Mutual labels:  coding-standards, php-codesniffer
phpcs-psr4-sniff
[READ-ONLY] PHP_CodeSniffer sniff that checks class name matches PSR-4 project structure.
Stars: ✭ 23 (-68.49%)
Mutual labels:  coding-standards, php-codesniffer
wptide
🌊 Tide is a series of automated tests run against every WordPress.org theme and plugin
Stars: ✭ 77 (+5.48%)
Mutual labels:  coding-standards, php-codesniffer
Codor
Custom PHPCS sniffs to find Code Smells
Stars: ✭ 40 (-45.21%)
Mutual labels:  coding-standards, php-codesniffer
Php codesniffer
PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.
Stars: ✭ 9,004 (+12234.25%)
Mutual labels:  coding-standards
cscs
A curated list of Coding Style Conventions and Standards.
Stars: ✭ 1,486 (+1935.62%)
Mutual labels:  coding-standards
coding-standard
Official Coding Standards for CodeIgniter
Stars: ✭ 24 (-67.12%)
Mutual labels:  coding-standards
codingstyle
Java coding style and template project used at Munich university of applied sciences
Stars: ✭ 19 (-73.97%)
Mutual labels:  coding-standards
development-best-practices
程序员开发规范,其中包括Java、JavaScript、CSS、Oracle、MySQL的开发编码规范和规约
Stars: ✭ 14 (-80.82%)
Mutual labels:  coding-standards
coding-standard
🐽 Tuned & very strict coding standards for PHP projects
Stars: ✭ 13 (-82.19%)
Mutual labels:  coding-standards
Twig-CS-Fixer
A tool to automatically fix Twig Coding Standards issues
Stars: ✭ 61 (-16.44%)
Mutual labels:  coding-standards
phpcs-gitlab
Gitlab Report for PHP_CodeSniffer (display the violations in the Gitlab CI/CD Code Quality Report)
Stars: ✭ 29 (-60.27%)
Mutual labels:  php-codesniffer
Coding-Standards
Coding Guidelines for C#
Stars: ✭ 125 (+71.23%)
Mutual labels:  coding-standards
eslint-config-javascript
Write bulletproof JavaScript like a pro! 😎
Stars: ✭ 34 (-53.42%)
Mutual labels:  coding-standards
php-toolbox
🐳 A Docker image designed for PHP developers that care about code quality.
Stars: ✭ 18 (-75.34%)
Mutual labels:  php-codesniffer
grunt-wp-css
Format style sheets according to the WordPress CSS coding standards.
Stars: ✭ 36 (-50.68%)
Mutual labels:  coding-standards
sprint tutorial
Tutorial and mock repository to teach people to contribute to open source
Stars: ✭ 18 (-75.34%)
Mutual labels:  coding-standards
wpcs-docs
WordPress Coding Standards Docs
Stars: ✭ 59 (-19.18%)
Mutual labels:  coding-standards
eslint-config-naver
Naver JavaScript Coding Conventions rules for eslint
Stars: ✭ 184 (+152.05%)
Mutual labels:  coding-standards

Consistence Coding Standard

Complete standard is described in a separate document.

This is a custom coding standard, which is used by all Consistence projects. It is also suitable to be used with any other project or as a foundation for your own standard.

The main objectives of this standard are:

  • Strict (and predictable) code.
  • Prevent common mistakes.
  • Readability over writability (character count).
  • Be friendly to diffs - minimize impact of changes.
  • Do not write unnecessary/unreliable information.

Automatic checks

Automatic checks of this standard are implemented as sniffs for PHP_CodeSniffer (phpcs), but not all the rules are checked yet. PHP_CodeSniffer contains also tool for automatic correction of certain errors phpcbf, but this tool is also not 100% reliable - results produced by this may not conform to this standard.

These checks also include some code analysis tools, such as detecting unreachable code etc. These are not part of the standard, but should be helpful.

Stability

This package uses SemVer with following rules.

Coding Standard document should be considered the source of truth and main object of SemVer.

  • MAJOR version will be incremented if new rules are added to the document.
  • MINOR version will be incremented if new sniffs are implemented to check for existing described rules.
  • PATCH version will be incremented for bug fixing - fixing a bug is considered everything which does not conform to the document - this may even lead to (temporarily) disabling an existing sniff - or part of it, until a better check is available or it is properly fixed.

The implementation of the automatic checks (both custom sniffs and the ruleset.xml file) are not subject to the SemVer and may change over time to accommodate changes in PHP_CodeSniffer and provided default sniffs, which are used also by this standard.

Recommended dependency on this package is on MINOR version (e.g. ~1.0.0), which means effectively:

  • No new rules will be added.
  • New automatic checks may be added.
  • You get fixes for existing automatic checks, or some of them may be disabled, if regressions are found.

Installation & usage

Install package consistence/coding-standard with Composer:

composer require --dev consistence/coding-standard

Then run phpcs with this standard:

vendor/bin/phpcs --standard=vendor/consistence/coding-standard/Consistence/ruleset.xml --extensions=php --encoding=utf-8 -sp src

For further usage options see the PHP_CodeSniffer documentation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].