Skip to content

Commit 37c6da9

Browse files
authored
Merge pull request #399 from PHPCSStandards/develop
Release 1.0.0-alpha4
2 parents a16c989 + e3bb76d commit 37c6da9

File tree

417 files changed

+51940
-16671
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

417 files changed

+51940
-16671
lines changed

.coveralls.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
coverage_clover: build/logs/clover.xml
22
json_path: build/logs/coveralls-upload.json
3-
service_name: travis-ci

.gitattributes

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,27 @@
22
# Exclude these files from release archives.
33
# This will also make them unavailable when using Composer with `--prefer-dist`.
44
# If you develop for this repo using Composer, use `--prefer-source`.
5-
# https://www.reddit.com/r/PHP/comments/2jzp6k/i_dont_need_your_tests_in_my_production
5+
# https://www.reddit.com/r/PHP/comments/2jzp6k/i_dont_need_your_tests_in_my_production/
66
# https://blog.madewithlove.be/post/gitattributes/
77
#
8-
/.coveralls.yml export-ignore
9-
/.gitattributes export-ignore
10-
/.gitignore export-ignore
11-
/.travis.yml export-ignore
12-
/phpcs.xml.dist export-ignore
13-
/phpdoc.xml.dist export-ignore
14-
/phpunit.xml.dist export-ignore
15-
/docs/ export-ignore
16-
/Tests/ export-ignore
8+
.coveralls.yml export-ignore
9+
.gitattributes export-ignore
10+
.gitignore export-ignore
11+
.markdownlint-cli2.yaml export-ignore
12+
.remarkignore export-ignore
13+
.remarkrc export-ignore
14+
.yamllint.yml export-ignore
15+
phpcs.xml.dist export-ignore
16+
phpdoc.dist.xml export-ignore
17+
phpdoc.xml.dist export-ignore
18+
phpunit.xml.dist export-ignore
19+
/.github/ export-ignore
20+
/docs/ export-ignore
21+
/Tests/ export-ignore
1722

1823
#
1924
# Auto detect text files and perform LF normalization
20-
# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/
25+
# https://pablorsk.medium.com/be-a-git-ninja-the-gitattributes-file-e58c07c9e915
2126
#
2227
* text=auto
2328

.github/dependabot.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Dependabot configuration.
2+
#
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "composer"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+
open-pull-requests-limit: 5 # Set to 0 to (temporarily) disable.
13+
versioning-strategy: widen
14+
commit-message:
15+
prefix: "Composer:"
16+
include: "scope"
17+
labels:
18+
- "Type: chores/QA"
19+
20+
- package-ecosystem: "github-actions"
21+
directory: "/"
22+
schedule:
23+
interval: "daily"
24+
open-pull-requests-limit: 5
25+
commit-message:
26+
prefix: "GH Actions:"
27+
labels:
28+
- "Type: chores/QA"

.github/release-checklist.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Template to use for release PRs from `develop` to `stable`
2+
3+
PR for tracking changes for the x.x.x release. Target release date: **DOW MONTH DAY YEAR**.
4+
5+
## Release checklist
6+
7+
### Update website
8+
9+
- [ ] Regenerate the PHPDoc documentation - PR #xxx
10+
:pencil2: Clear out the `docs/phpdoc` directory and then use phpDocumentor 3 with the command `phpdoc`
11+
- [ ] Sync any changes in the Readme into the website `index.md` file. - PR #xxx
12+
:pencil2: Copy & paste the content from the `README.md` file to `docs/index.md` (and double-check the few remaining differences are intact).
13+
To verify the output locally:
14+
```bash
15+
bundle update
16+
bundle exec jekyll serve
17+
```
18+
and then visiting <http://localhost:4000/> to see the result.
19+
20+
### General
21+
22+
- [ ] Verify, and if necessary, update the version constraints for dependencies in the `composer.json` - PR #xxx
23+
- [ ] Verify that any new functions have type declarations whenever possible.
24+
- [ ] Add changelog for the release - PR #xxx
25+
:pencil2: Remember to add a release link at the bottom and to adjust the link for "Unreleased"!
26+
27+
### Release
28+
29+
- [ ] Merge this PR
30+
- [ ] Make sure all CI builds are green.
31+
- [ ] Verify that the website regenerated correctly.
32+
- [ ] Tag the release (careful, GH defaults to `develop`!).
33+
- [ ] Create a release from the tag (careful, GH defaults to `develop`!) & copy & paste the changelog to it.
34+
:pencil2: Don't forget to copy the link collection from the bottom of the changelog!
35+
- [ ] Close the milestone
36+
- [ ] Open a new milestone for the next release
37+
- [ ] If any open PRs/issues which were milestoned for this release did not make it into the release, update their milestone.
38+
- [ ] Fast-forward `develop` to be equal to `stable`
39+
40+
### Publicize
41+
42+
- [ ] Tweet about the release.
43+
- [ ] Inform the primary dependants of this repo (PHPCSExtra, WordPressCS, PHPCompatibility and VariableAnalysis) about the release.

.github/workflows/basics.yml

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
name: CS
2+
3+
on:
4+
# Run on all pushes and on all pull requests.
5+
# Prevent the build from running when there are only irrelevant changes.
6+
push:
7+
pull_request:
8+
# Allow manually triggering the workflow.
9+
workflow_dispatch:
10+
11+
# Cancels all previous workflow runs for the same branch that have not yet completed.
12+
concurrency:
13+
# The concurrency group contains the workflow name and the branch name.
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
checkcs:
19+
name: 'Basic CS and QA checks'
20+
runs-on: ubuntu-latest
21+
22+
env:
23+
XMLLINT_INDENT: ' '
24+
# - COMPOSER_ROOT_VERSION is needed to get round the recursive dependency when using CI.
25+
COMPOSER_ROOT_VERSION: '1.99.99'
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v3
30+
31+
- name: Install PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: '7.4'
35+
coverage: none
36+
tools: cs2pr
37+
38+
# Validate the composer.json file.
39+
# @link https://getcomposer.org/doc/03-cli.md#validate
40+
- name: Validate Composer installation
41+
run: composer validate --no-check-all --strict
42+
43+
- name: 'Composer: adjust dependencies'
44+
run: |
45+
# The sniff stage doesn't run the unit tests, so no need for PHPUnit.
46+
composer remove --no-update --dev phpunit/phpunit --no-scripts
47+
# Using PHPCS `master` as an early detection system for bugs upstream.
48+
composer require --no-update squizlabs/php_codesniffer:"dev-master"
49+
50+
# Install dependencies and handle caching in one go.
51+
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
52+
- name: Install Composer dependencies
53+
uses: "ramsey/composer-install@v2"
54+
55+
- name: Install xmllint
56+
run: |
57+
sudo apt-get update
58+
sudo apt-get install --no-install-recommends -y libxml2-utils
59+
60+
# Show XML violations inline in the file diff.
61+
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
62+
- uses: korelstar/xmllint-problem-matcher@v1
63+
64+
# Validate the XML file.
65+
# @link http://xmlsoft.org/xmllint.html
66+
- name: Validate rulesets against schema
67+
run: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd ./*/ruleset.xml
68+
69+
# Check the code-style consistency of the XML file.
70+
- name: Check XML code style
71+
run: |
72+
diff -B ./PHPCSUtils/ruleset.xml <(xmllint --format "./PHPCSUtils/ruleset.xml")
73+
diff -B ./PHPCS23Utils/ruleset.xml <(xmllint --format "./PHPCS23Utils/ruleset.xml")
74+
75+
# Check the code-style consistency of the PHP files.
76+
- name: Check PHP code style
77+
id: phpcs
78+
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml
79+
80+
- name: Show PHPCS results in PR
81+
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
82+
run: cs2pr ./phpcs-report.xml
83+
84+
markdownlint:
85+
name: 'Lint Markdown'
86+
runs-on: ubuntu-latest
87+
88+
steps:
89+
- name: Checkout code
90+
uses: actions/checkout@v3
91+
92+
# This action also handles the caching of the dependencies.
93+
# https://github.com/actions/setup-node
94+
- name: Set up node and enable caching of dependencies
95+
uses: actions/setup-node@v3
96+
with:
97+
node-version: '16'
98+
99+
# @link https://github.com/DavidAnson/markdownlint-cli2
100+
# @link https://github.com/DavidAnson/markdownlint
101+
- name: Install Markdownlint CLI2
102+
run: npm install -g markdownlint-cli2
103+
104+
# @link https://github.com/marketplace/actions/problem-matcher-for-markdownlint-cli
105+
- name: Enable showing issue in PRs
106+
uses: xt0rted/markdownlint-problem-matcher@v2
107+
108+
- name: Check markdown with CLI2
109+
run: markdownlint-cli2
110+
111+
remark:
112+
name: 'QA Markdown'
113+
runs-on: ubuntu-latest
114+
115+
steps:
116+
- name: Checkout code
117+
uses: actions/checkout@v3
118+
119+
- name: Set up node and enable caching of dependencies
120+
uses: actions/setup-node@v3
121+
with:
122+
node-version: '16'
123+
124+
# To make the command available on CLI, it needs to be installed globally.
125+
- name: Install Remark CLI globally
126+
run: npm install --global remark-cli --foreground-scripts true --fund false
127+
128+
# To allow for creating a custom config which references rules which are included
129+
# in the presets, without having to install all rules individually, a local install
130+
# works best (and installing the presets in the first place, of course).
131+
#
132+
# Note: the first group of packages are all part of the mono "Remark lint" repo.
133+
# The second group of packages (heading-whitespace and down) are additional
134+
# "external" rules/plugins.
135+
- name: Install Remark rules locally
136+
run: >
137+
npm install --foreground-scripts true --fund false
138+
remark-lint
139+
remark-gfm
140+
remark-preset-lint-consistent
141+
remark-preset-lint-recommended
142+
remark-preset-lint-markdown-style-guide
143+
remark-lint-checkbox-content-indent
144+
remark-lint-linebreak-style
145+
remark-lint-no-duplicate-defined-urls
146+
remark-lint-no-empty-url
147+
remark-lint-no-heading-like-paragraph
148+
remark-lint-no-reference-like-url
149+
remark-lint-no-unneeded-full-reference-image
150+
remark-lint-no-unneeded-full-reference-link
151+
remark-lint-strikethrough-marker
152+
remark-lint-heading-whitespace
153+
remark-lint-list-item-punctuation
154+
remark-lint-match-punctuation
155+
remark-lint-no-hr-after-heading
156+
remark-lint-are-links-valid-alive
157+
remark-lint-are-links-valid-duplicate
158+
remark-validate-links
159+
160+
- name: Run Remark-lint
161+
run: remark . --frail
162+
163+
# @link https://github.com/reviewdog/action-remark-lint
164+
- name: Show Remark-lint annotations in PR
165+
if: ${{ failure() && github.event_name == 'pull_request' }}
166+
uses: reviewdog/action-remark-lint@v5
167+
with:
168+
fail_on_error: true
169+
install_deps: false
170+
level: info
171+
reporter: github-pr-check
172+
173+
yamllint:
174+
name: 'Lint Yaml'
175+
runs-on: ubuntu-latest
176+
177+
steps:
178+
- name: Checkout code
179+
uses: actions/checkout@v3
180+
181+
- name: Run Yamllint on all yaml files in repo
182+
run: yamllint . --format colored --strict
183+
184+
- name: Pipe Yamllint results on to GH for inline display
185+
if: ${{ failure() }}
186+
run: yamllint . --format github --strict

.github/workflows/ghpages.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
paths:
6+
- 'docs/**'
7+
pull_request:
8+
paths:
9+
- 'docs/**'
10+
# Allow manually triggering the workflow.
11+
workflow_dispatch:
12+
13+
# Cancels all previous workflow runs for the same branch that have not yet completed.
14+
concurrency:
15+
# The concurrency group contains the workflow name and the branch name.
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
#### TEST DOCUMENTATION SITE GENERATION ####
21+
test:
22+
runs-on: ubuntu-latest
23+
24+
name: "Test build GHPages site"
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v3
29+
30+
- name: Set up Ruby
31+
uses: ruby/setup-ruby@v1
32+
with:
33+
# Use the version as per https://pages.github.com/versions/
34+
ruby-version: 2.7.4
35+
bundler-cache: true
36+
working-directory: docs
37+
38+
- name: Test building the GH Pages site
39+
run: |
40+
cd docs
41+
bundle exec jekyll build

0 commit comments

Comments
 (0)