Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nette/coding-standard
Nette Coding Standard code checker & fixer
https://github.com/nette/coding-standard
coding-standard nette php-code-sniffer php-cs-fixer php71
Last synced: 29 days ago
JSON representation
Nette Coding Standard code checker & fixer
- Host: GitHub
- URL: https://github.com/nette/coding-standard
- Owner: nette
- License: mit
- Created: 2016-09-23T10:38:47.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-07-11T07:45:48.000Z (4 months ago)
- Last Synced: 2024-09-27T05:40:59.616Z (about 1 month ago)
- Topics: coding-standard, nette, php-code-sniffer, php-cs-fixer, php71
- Language: PHP
- Homepage: https://doc.nette.org/en/contributing/coding-standard
- Size: 181 KB
- Stars: 39
- Watchers: 12
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nette Coding Standard code checker & fixer
[![Downloads this Month](https://img.shields.io/packagist/dm/nette/coding-standard.svg)](https://packagist.org/packages/nette/coding-standard)
[![Latest Stable Version](https://img.shields.io/packagist/v/nette/coding-standard.svg)](https://github.com/nette/coding-standard/releases)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)This is set of [sniffs](https://github.com/squizlabs/PHP_CodeSniffer) and [fixers](https://github.com/FriendsOfPHP/PHP-CS-Fixer) that **checks and fixes** code of Nette Framework against [Coding Standard in Documentation](https://doc.nette.org/en/contributing/coding-standard).
## Installation and Usage
Install the tool in a global directory. Its name will be for example `/nette-cs`:
```
composer create-project nette/coding-standard /nette-cs
```Check coding standard for PHP 7.1 in folders `src` and `tests`:
```bash
/nette-cs/ecs check src tests --preset php71
```And fix it:
```bash
/nette-cs/ecs fix src tests --preset php71
```If no PHP version is specified, it will try to find out from the `composer.json` file.
### GitHub Actions
```yaml
# .github/workflows/coding-style.yml
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 8.0- run: composer create-project nette/coding-standard temp/coding-standard
- run: php temp/coding-standard/ecs check src tests --preset php71```