Skip to content

Commit 1bb3437

Browse files
committed
Initial commit
1 parent add95ec commit 1bb3437

File tree

9 files changed

+338
-0
lines changed

9 files changed

+338
-0
lines changed

.dependabot/config.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 1
2+
update_configs:
3+
- package_manager: "php:composer"
4+
directory: "/"
5+
update_schedule: "weekly"
6+
automerged_updates:
7+
- match:
8+
dependency_type: "development"
9+
update_type: "all"
10+
- match:
11+
dependency_type: "production"
12+
update_type: "all"

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on:
2+
push:
3+
branch:
4+
- master
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@master
10+
- name: Build
11+
uses: elgohr/Publish-Docker-Github-Action@master
12+
with:
13+
name: docker.pkg.github.com/phpdocumentor/coding-standard/phpcs
14+
username: ${{ github.actor }}
15+
password: ${{ secrets.GITHUB_TOKEN }}
16+
registry: docker.pkg.github.com
17+
18+
- name: self-run
19+
uses: ./
20+
with:
21+
args: "--help"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/vendor

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM php:7.3-alpine
2+
3+
COPY --from=composer:1.8.4 /usr/bin/composer /usr/local/bin/composer
4+
5+
COPY . /opt/phpdoc
6+
RUN cd /opt/phpdoc && composer install
7+
8+
ENTRYPOINT ["/opt/phpdoc/entrypoint.sh"]
9+
CMD ["--help"]

action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: "phpdoc-cs-action"
2+
description: "phpDocumentor code style action using php-code-sniffer"
3+
branding:
4+
color: green
5+
icon: crosshair
6+
runs:
7+
using: docker
8+
image: docker.pkg.github.com/phpdocumentor/coding-standard/phpcs:latest

composer.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "phpdocumentor/coding-standard",
3+
"type": "phpcodesniffer-standard",
4+
"description": "The phpDocumentor Coding Standard is a set of PHPCS rules applied to all phpDocumentor projects.",
5+
"keywords": [
6+
"phpDocumentor",
7+
"coding",
8+
"standard",
9+
"cs",
10+
"code",
11+
"style",
12+
"sniffer",
13+
"rules",
14+
"sniffs",
15+
"checks"
16+
],
17+
"license": "MIT",
18+
"autoload": {
19+
"psr-4": {
20+
"phpDocumentor\\Sniffs\\": "lib/phpDocumentor/Sniffs"
21+
}
22+
},
23+
"require": {
24+
"php": "^7.2",
25+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
26+
"doctrine/coding-standard": "^5.0"
27+
},
28+
"config": {
29+
"sort-packages": true
30+
}
31+
}

composer.lock

Lines changed: 237 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh -l
2+
if [ "$1" = 'phpcbf' ]; then
3+
COMMAND=$(echo "${*}" | cut -c 8-)
4+
sh -c "/opt/phpdoc/vendor/bin/phpcbf ${COMMAND}"
5+
else
6+
sh -c "/opt/phpdoc/vendor/bin/phpcs $*"
7+
fi

lib/phpDocumentor/ruleset.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<ruleset
3+
name="phpDocumentor"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="../../vendor/squizlabs/php_codesniffer/phpcs.xsd"
6+
>
7+
<description>The phpDocumentor coding standard.</description>
8+
9+
<!-- Import Doctrine coding standard (base) -->
10+
<rule ref="Doctrine">
11+
</rule>
12+
</ruleset>

0 commit comments

Comments
 (0)