Skip to content

Commit 0a0f585

Browse files
authored
Merge pull request #24 from crowdsecurity/new-features
- make crowdsec mentions hidable - remove useless dockerfiles - add phpcs-fixer - lint pass
2 parents 9750477 + 6e5d83a commit 0a0f585

24 files changed

+2318
-244
lines changed

.php_cs

+2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ return PhpCsFixer\Config::create()
1616
'native_constant_invocation' => true,
1717
'combine_nested_dirname' => true,
1818
'list_syntax' => ['syntax' => 'short'],
19+
'phpdoc_to_comment' => false,
1920
])
2021
->setRiskyAllowed(true)
2122
->setFinder(
2223
PhpCsFixer\Finder::create()
2324
->in(__DIR__.'/src')
25+
->in(__DIR__.'/tests')
2426
)
2527
;

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
> The official PHP bouncer library for the CrowdSec LAPI/CAPI
88
9-
<p align="center">
10-
<img src="https://img.shields.io/github/workflow/status/crowdsecurity/php-cs-bouncer/tests/main">
11-
<img src="https://img.shields.io/github/license/crowdsecurity/php-cs-bouncer">
12-
<img src="https://img.shields.io/github/v/release/crowdsecurity/php-cs-bouncer?include_prereleases">
13-
</p>
9+
![Version](https://img.shields.io/github/v/release/crowdsecurity/php-cs-bouncer?include_prereleases)
10+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=crowdsecurity_php-cs-bouncer&metric=alert_status)](https://sonarcloud.io/dashboard?id=crowdsecurity_php-cs-bouncer)
11+
![Build Status](https://img.shields.io/github/workflow/status/crowdsecurity/php-cs-bouncer/tests/main)
12+
![Licence](https://img.shields.io/github/license/crowdsecurity/php-cs-bouncer)
13+
1414

1515
<p align="center">
1616
:books: <a href="https://doc.crowdsec.net">Documentation</a>

docker/php-7.0.Dockerfile

-19
This file was deleted.

docker/php-7.1.Dockerfile

-17
This file was deleted.

docker/php-7.1.opcache.ini

-11
This file was deleted.

docs/api/ApiCache.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Used for the stream mode when we have to update the remediations list.
164164

165165
`array`
166166

167-
> number of deleted and new decisions.
167+
> number of deleted and new decisions
168168
169169

170170
<hr />
@@ -191,7 +191,7 @@ Used when the stream mode has just been activated.
191191

192192
`int`
193193

194-
> number of decisions added.
194+
> number of decisions added
195195
196196

197197
<hr />

docs/api/Bouncer.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ This method should be called periodically (ex: crontab) in a asynchronous way to
289289

290290
`array`
291291

292-
> number of deleted and new decisions.
292+
> number of deleted and new decisions
293293
294294

295295
<hr />
@@ -315,7 +315,7 @@ This method should be called only to force a cache warm up.
315315

316316
`int`
317317

318-
> number of decisions added.
318+
> number of decisions added
319319
320320

321321
<hr />

docs/contribute.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ docker run -e "FILTER_REGEX_INCLUDE=/tmp/lint/src/.*" -e RUN_LOCAL=true -v ${PWD
4747

4848
Full details here: https://github.com/github/super-linter/blob/master/docs/run-linter-locally.md
4949

50+
To autolint with phpcs-fixer:
51+
52+
```bash
53+
composer install --working-dir=tools/php-cs-fixer
54+
PHP_CS_FIXER_IGNORE_ENV=1 tools/php-cs-fixer/vendor/bin/php-cs-fixer fix
55+
```
56+
5057
## How to generate PHP Doc
5158

5259
```bash
@@ -62,9 +69,15 @@ We use the git workflow [Github Flow](https://guides.github.com/introduction/flo
6269
```bash
6370
git checkout -b <basic-name> # the name is not important now, you can type "new-features"
6471
git commit # as mush as necessary.
65-
docker-compose run --rm app vendor/bin/phpdoc-md # regenerate php doc
72+
73+
PHP_CS_FIXER_IGNORE_ENV=1 tools/php-cs-fixer/vendor/bin/php-cs-fixer fix # fix coding standards
74+
docker run -e "FILTER_REGEX_INCLUDE=/tmp/lint/src/.*" -e RUN_LOCAL=true -v ${PWD}:/tmp/lint github/super-linter # super linter local pass
75+
./tests-local.sh # check tests are still OK
76+
docker-compose run --rm app vendor/bin/phpdoc-md # Regenerate php doc
77+
6678
git branch -m <name-of-the-branch> # to rename the branch to what has really be done.
6779
git push origin :<basic-name> && git push origin <name-of-the-branch> # Only if already pushed
80+
6881
gh pr create --fill
6982
```
7083

0 commit comments

Comments
 (0)