Skip to content

Commit

Permalink
Merge pull request #299 from wayofdev/docs/updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp authored Jun 7, 2024
2 parents 71ed174 + 47a5ad4 commit 2fdfca4
Show file tree
Hide file tree
Showing 15 changed files with 82 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":semanticCommitTypeAll(ci)"
":semanticCommitTypeAll(deps)"
],
"automerge": true,
"platformAutomerge": true,
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/dependency-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
---

on: # yamllint disable-line rule:truthy
pull_request:
push:
branches:
- master
paths:
- 'src/**'
- 'tests/**'
- '.php-cs-fixer.dist.php'
- 'composer.*'
push:
pull_request:
branches:
- master
paths:
- 'src/**'
- 'tests/**'
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ repos:
- id: check-added-large-files
args: ['--maxkb=600']

- repo: https://github.com/commitizen-tools/commitizen
rev: v3.27.0
hooks:
- id: commitizen
stages:
- commit-msg

- repo: local
hooks:
- id: php-cs-fixer
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ MARKDOWN_LINT_RUNNER ?= $(DOCKER) run --rm $$(tty -s && echo "-it" || echo) \

PHIVE_RUNNER ?= $(DOCKER_COMPOSE) run --rm --no-deps app

NPM_RUNNER ?= pnpm

EXPORT_VARS = '\
$${COMPOSE_PROJECT_NAME} \
$${COMPOSER_AUTH} \
Expand Down Expand Up @@ -97,7 +99,7 @@ help: ## Show this menu
@echo ' 📑 Logs are stored in $(MAKE_LOGFILE)'
@echo
@echo ' 📦 Package php-cs-fixer-config (https://github.com/wayofdev/php-cs-fixer-config)'
@echo ' 🤠 Makefile Author Andrij Orlenko (https://github.com/lotyp)'
@echo ' 🤠 Author Andrij Orlenko (https://github.com/lotyp)'
@echo ' 🏢 ${YELLOW}Org wayofdev (https://github.com/wayofdev)${RST}'
@echo
.PHONY: help
Expand Down
48 changes: 27 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div align="center">
<p align="center">
<br>
<a href="https://wayof.dev" target="_blank">
<picture>
Expand All @@ -7,18 +7,29 @@
</picture>
</a>
<br>
<br>
</div>
</p>

<p align="center">
<a href="https://github.com/wayofdev/php-cs-fixer-config/actions" target="_blank"><img alt="Build Status" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fwayofdev%2Fphp-cs-fixer-config%2Fbadge&style=flat-square&label=github%20actions"/></a>
<a href="https://packagist.org/packages/wayofdev/php-cs-fixer-config" target="_blank"><img src="https://img.shields.io/packagist/dt/wayofdev/cs-fixer-config?&style=flat-square" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/wayofdev/php-cs-fixer-config" target="_blank"><img src="https://img.shields.io/packagist/v/wayofdev/cs-fixer-config?&style=flat-square" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/wayofdev/php-cs-fixer-config" target="_blank"><img alt="Commits since latest release" src="https://img.shields.io/github/commits-since/wayofdev/php-cs-fixer-config/latest?style=flat-square"></a>
<a href="https://packagist.org/packages/wayofdev/php-cs-fixer-config" target="_blank"><img alt="PHP Version Require" src="https://poser.pugx.org/wayofdev/cs-fixer-config/require/php?style=flat-square"></a>
<a href="https://app.codecov.io/gh/wayofdev/php-cs-fixer-config" target="_blank"><img alt="Codecov" src="https://img.shields.io/codecov/c/github/wayofdev/php-cs-fixer-config?style=flat-square&logo=codecov"></a>
<a href="https://dashboard.stryker-mutator.io/reports/github.com/wayofdev/php-cs-fixer-config/master" target="_blank"><img alt="Mutation testing badge" src="https://img.shields.io/endpoint?style=flat-square&label=mutation%20score&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fwayofdev%2Fphp-cs-fixer-config%2Fmaster"></a>
<a href=""><img src="https://img.shields.io/badge/phpstan%20level-9%20of%209-brightgreen?style=flat-square" alt="PHP Stan Level 9 of 9"></a>
<strong>Build</strong><br>
<a href="https://github.com/wayofdev/php-cs-fixer-config/actions" target="_blank"><img alt="Build Status" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fwayofdev%2Fphp-cs-fixer-config%2Fbadge&style=flat-square&label=github%20actions"/></a>
</p>
<p align="center">
<strong>Project</strong><br>
<a href="https://packagist.org/packages/wayofdev/cs-fixer-config" target="_blank"><img src="https://img.shields.io/packagist/dt/wayofdev/cs-fixer-config?&style=flat-square" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/wayofdev/cs-fixer-config" target="_blank"><img src="https://img.shields.io/packagist/v/wayofdev/cs-fixer-config?&style=flat-square" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/wayofdev/cs-fixer-config" target="_blank"><img alt="Commits since latest release" src="https://img.shields.io/github/commits-since/wayofdev/php-cs-fixer-config/latest?style=flat-square"></a>
<a href="https://packagist.org/packages/wayofdev/cs-fixer-config" target="_blank"><img alt="PHP Version Require" src="https://poser.pugx.org/wayofdev/cs-fixer-config/require/php?style=flat-square"></a>
</p>
<p align="center">
<strong>Quality</strong><br>
<a href="https://app.codecov.io/gh/wayofdev/php-cs-fixer-config" target="_blank"><img alt="Codecov" src="https://img.shields.io/codecov/c/github/wayofdev/php-cs-fixer-config?style=flat-square&logo=codecov"></a>
<a href="https://dashboard.stryker-mutator.io/reports/github.com/wayofdev/php-cs-fixer-config/master" target="_blank"><img alt="Mutation testing badge" src="https://img.shields.io/endpoint?style=flat-square&label=mutation%20score&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fwayofdev%2Fphp-cs-fixer-config%2Fmaster"></a>
<a href=""><img src="https://img.shields.io/badge/phpstan%20level-9%20of%209-brightgreen?style=flat-square" alt="PHP Stan Level 9 of 9"></a>
</p>
<p align="center">
<strong>Community</strong><br>
<a href="https://discord.gg/CE3TcCC5vr" target="_blank"><img alt="Discord" src="https://img.shields.io/discord/1228506758562058391?style=flat-square&logo=discord&labelColor=7289d9&logoColor=white&color=39456d"></a>
<a href="https://x.com/intent/follow?screen_name=wayofdev" target="_blank"><img alt="Follow on Twitter (X)" src="https://img.shields.io/badge/-Follow-black?style=flat-square&logo=X"></a>
</p>

<br>
Expand Down Expand Up @@ -307,23 +318,18 @@ You are more than welcome. Before contributing, kindly check our [contribution g
## 🫡 Contributors

<p align="left">
<a href="https://github.com/wayofdev/php-cs-fixer-config/graphs/contributors">
<img align="left" src="https://img.shields.io/github/contributors-anon/wayofdev/php-cs-fixer-config?style=for-the-badge" alt="Contributors Badge"/>
</a>
</p>

<a href="https://github.com/wayofdev/php-cs-fixer-config/graphs/contributors">
<img align="left" src="https://img.shields.io/github/contributors-anon/wayofdev/php-cs-fixer-config?style=for-the-badge" alt="Contributors Badge"/>
</a>
<br>
<br>
</p>

## 🌐 Social Links

* **Twitter:** Follow our organization [@wayofdev](https://twitter.com/intent/follow?screen_name=wayofdev) and the author [@wlotyp](https://twitter.com/intent/follow?screen_name=wlotyp).
* **Discord:** Join our community on [Discord](https://discord.gg/CE3TcCC5vr).

<p align="left">
<a href="https://discord.gg/CE3TcCC5vr" target="_blank"><img alt="Discord Link" src="https://img.shields.io/discord/1228506758562058391?style=for-the-badge&logo=discord&labelColor=7289d9&logoColor=white&color=39456d"></a>
<a href="https://x.com/intent/follow?screen_name=wayofdev" target="_blank"><img alt="Follow on Twitter (X)" src="https://img.shields.io/badge/-Follow-black?style=for-the-badge&logo=X"></a>
</p>

<br>

## 🧱 Resources
Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wayofdev/cs-fixer-config",
"description": "Package adds custom rule-sets to php-cs-fixer",
"description": "🧹 Adds custom rule-sets to PHP CS Fixer for consistent coding standards.",
"license": "MIT",
"type": "library",
"keywords": [
Expand All @@ -23,7 +23,8 @@
"homepage": "https://wayof.dev",
"support": {
"issues": "https://github.com/wayofdev/php-cs-fixer-config/issues",
"source": "https://github.com/wayofdev/php-cs-fixer-config"
"source": "https://github.com/wayofdev/php-cs-fixer-config",
"security": "https://github.com/wayofdev/php-cs-fixer-config/blob/master/.github/SECURITY.md"
},
"require": {
"php": "^8.1",
Expand All @@ -38,19 +39,21 @@
"phpstan/phpstan-phpunit": "^1.4",
"phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "^10.5",
"psalm/plugin-phpunit": "~0.19.0",
"psalm/plugin-phpunit": "^0.19",
"rector/rector": "^1.1",
"roave/infection-static-analysis-plugin": "^1.35",
"vimeo/psalm": "^5.23.1"
"vimeo/psalm": "^5.24"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"WayOfDev\\PhpCsFixer\\Config\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"WayOfDev\\Tests\\": "tests/"
"WayOfDev\\Tests\\": "tests/src/"
}
},
"config": {
Expand Down
30 changes: 15 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pest.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</extensions>
<testsuites>
<testsuite name="Arch Tests">
<directory>tests/Arch</directory>
<directory>tests/src/Arch</directory>
</testsuite>
</testsuites>
<source>
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ parameters:
- tests/
- .php-cs-fixer.dist.php
excludePaths:
- tests/Arch
- tests/src/Arch
tmpDir: .build/phpstan/
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
cacheResultFile=".build/phpunit/result.cache"
Expand All @@ -15,7 +15,7 @@
</extensions>
<testsuites>
<testsuite name="Unit Tests">
<directory>tests/Unit</directory>
<directory>tests/src/Unit</directory>
</testsuite>
</testsuites>
<coverage>
Expand Down
4 changes: 2 additions & 2 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<code><![CDATA[ExtendedPERSet]]></code>
</UnusedClass>
</file>
<file src="tests/Unit/ConfigBuilderTest.php">
<file src="tests/src/Unit/ConfigBuilderTest.php">
<InvalidOperand>
<code><![CDATA[$finder]]></code>
<code><![CDATA[$this->builder->getConfig()->getFinder()]]></code>
Expand All @@ -27,7 +27,7 @@
<code><![CDATA[invalidMethod]]></code>
</UndefinedMagicMethod>
</file>
<file src="tests/Unit/RuleSets/DefaultSetTest.php">
<file src="tests/src/Unit/RuleSets/DefaultSetTest.php">
<PossiblyUnusedMethod>
<code><![CDATA[it_allows_risky_rules]]></code>
<code><![CDATA[it_merges_custom_rules_with_default_rules]]></code>
Expand Down
5 changes: 3 additions & 2 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@

<projectFiles>
<directory name="src/"/>
<directory name="tests/"/>
<directory name="tests/src/"/>
<ignoreFiles>
<directory name="tests/Arch"/>
<directory name="tests/src/Arch/"/>
</ignoreFiles>
<file name=".php-cs-fixer.dist.php"/>
<file name="rector.php"/>
</projectFiles>
</psalm>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ public function it_has_no_directories_by_default(): void
public function it_adds_directories(): void
{
$finder = $this->builder
->inDir(__DIR__ . '/../../src')
->inDir(__DIR__ . '/../../tests')
->inDir(__DIR__ . '/../../../src')
->inDir(__DIR__ . '/../../../tests/src')
->getConfig()
->getFinder()
;

$items = $this->finderToArray($finder);

self::assertContains(__FILE__, $items);
self::assertContains(realpath(__DIR__ . '/../../src/ConfigBuilder.php'), $items);
self::assertContains(realpath(__DIR__ . '/../../../src/ConfigBuilder.php'), $items);
}

#[Test]
Expand Down Expand Up @@ -123,15 +123,15 @@ public function it_overrides_default_rules(): void
public function it_excludes_directories(): void
{
$finder = $this->builder
->exclude([__DIR__ . '/../../src/RuleSets'])
->inDir(__DIR__ . '/../../src')
->exclude([__DIR__ . '/../../../src/RuleSets'])
->inDir(__DIR__ . '/../../../src')
->getConfig()
->getFinder()
;

$items = $this->finderToArray($finder);

self::assertNotContains(__DIR__ . '/../../src/RuleSets/DefaultSet.php', $items);
self::assertNotContains(__DIR__ . '/../../../src/RuleSets/DefaultSet.php', $items);
}

#[Test]
Expand Down
File renamed without changes.

0 comments on commit 2fdfca4

Please sign in to comment.