Skip to content

Commit 5ab4e9e

Browse files
authored
Merge pull request #200 from PHPCSStandards/develop
Release PHPCSExtra 1.0.0
2 parents e0e58d3 + fcd8cb5 commit 5ab4e9e

File tree

15 files changed

+242
-88
lines changed

15 files changed

+242
-88
lines changed

.gitattributes

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@
55
# 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-
/.github/ export-ignore
12-
/phpcs.xml.dist export-ignore
13-
/phpunit.xml.dist export-ignore
14-
/phpunit-bootstrap.php export-ignore
15-
/Modernize/Tests/ export-ignore
8+
.coveralls.yml export-ignore
9+
.gitattributes export-ignore
10+
.gitignore export-ignore
11+
.remarkignore export-ignore
12+
.remarkrc export-ignore
13+
.yamllint.yml export-ignore
14+
phpcs.xml.dist export-ignore
15+
phpunit.xml.dist export-ignore
16+
phpunit-bootstrap.php export-ignore
17+
/.github/ export-ignore
18+
/Modernize/Tests/ export-ignore
1619
/NormalizedArrays/Tests/ export-ignore
17-
/Universal/Tests/ export-ignore
20+
/Universal/Tests/ export-ignore
1821

1922
#
2023
# Auto detect text files and perform LF normalization

.github/release-checklist.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
### General
8+
9+
- [ ] Verify, and if necessary, update the allowed version ranges for various dependencies in the `composer.json` - PR #xxx
10+
- [ ] Add changelog for the release - PR #xxx
11+
:pencil2: Remember to add a release link at the bottom!
12+
- [ ] Update sniff list in `README` (if applicable) - PR #xxx.
13+
14+
### Release
15+
16+
- [ ] Merge this PR
17+
- [ ] Make sure all CI builds are green.
18+
- [ ] Tag and create a release (careful, GH defaults to `develop`!) & copy & paste the changelog to it.
19+
:pencil2: Don't forget to copy the link collection from the bottom of the changelog!
20+
- [ ] Make sure all CI builds are green.
21+
- [ ] Close the milestone
22+
- [ ] Open a new milestone for the next release
23+
- [ ] If any open PRs/issues which were milestoned for this release did not make it into the release, update their milestone.
24+
- [ ] Fast-forward `develop` to be equal to `master`
25+
26+
### Publicize
27+
- [ ] Tweet about the release.

.github/workflows/basics.yml

Lines changed: 84 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ jobs:
3737
coverage: none
3838
tools: cs2pr
3939

40+
# Validate the composer.json file.
41+
# @link https://getcomposer.org/doc/03-cli.md#validate
42+
- name: Validate Composer installation
43+
run: composer validate --no-check-all --strict
44+
4045
- name: 'Composer: adjust dependencies'
4146
run: |
4247
# The sniff stage doesn't run the unit tests, so no need for PHPUnit.
@@ -49,8 +54,8 @@ jobs:
4954
- name: Install Composer dependencies
5055
uses: "ramsey/composer-install@v2"
5156
with:
52-
# Bust the cache at least once a month - output format: YYYY-MM-DD.
53-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
57+
# Bust the cache at least once a month - output format: YYYY-MM.
58+
custom-cache-suffix: $(date -u "+%Y-%m")
5459

5560
- name: Install xmllint
5661
run: |
@@ -92,7 +97,80 @@ jobs:
9297
- name: Check sniff feature completeness
9398
run: composer check-complete
9499

95-
# Validate the composer.json file.
96-
# @link https://getcomposer.org/doc/03-cli.md#validate
97-
- name: Validate Composer installation
98-
run: composer validate --no-check-all --strict
100+
remark:
101+
name: 'QA Markdown'
102+
runs-on: ubuntu-latest
103+
104+
steps:
105+
- name: Checkout code
106+
uses: actions/checkout@v3
107+
108+
- name: Set up node and enable caching of dependencies
109+
uses: actions/setup-node@v3
110+
with:
111+
node-version: '16'
112+
113+
# To make the command available on CLI, it needs to be installed globally.
114+
- name: Install Remark CLI globally
115+
run: npm install --global remark-cli --foreground-scripts true --fund false
116+
117+
# To allow for creating a custom config which references rules which are included
118+
# in the presets, without having to install all rules individually, a local install
119+
# works best (and installing the presets in the first place, of course).
120+
#
121+
# Note: the first group of packages are all part of the mono "Remark lint" repo.
122+
# The second group of packages (heading-whitespace and down) are additional
123+
# "external" rules/plugins.
124+
- name: Install Remark rules locally
125+
run: >
126+
npm install --foreground-scripts true --fund false
127+
remark-lint
128+
remark-gfm
129+
remark-preset-lint-consistent
130+
remark-preset-lint-recommended
131+
remark-preset-lint-markdown-style-guide
132+
remark-lint-checkbox-content-indent
133+
remark-lint-linebreak-style
134+
remark-lint-no-duplicate-defined-urls
135+
remark-lint-no-empty-url
136+
remark-lint-no-heading-like-paragraph
137+
remark-lint-no-reference-like-url
138+
remark-lint-no-unneeded-full-reference-image
139+
remark-lint-no-unneeded-full-reference-link
140+
remark-lint-strikethrough-marker
141+
remark-lint-heading-whitespace
142+
remark-lint-list-item-punctuation
143+
remark-lint-match-punctuation
144+
remark-lint-no-hr-after-heading
145+
remark-lint-are-links-valid-alive
146+
remark-lint-are-links-valid-duplicate
147+
remark-validate-links
148+
149+
- name: Run Remark-lint
150+
run: remark . --frail
151+
152+
# @link https://github.com/reviewdog/action-remark-lint
153+
- name: Show Remark-lint annotations in PR
154+
if: ${{ failure() && github.event_name == 'pull_request' }}
155+
uses: reviewdog/action-remark-lint@v5
156+
with:
157+
fail_on_error: true
158+
install_deps: false
159+
level: info
160+
reporter: github-pr-check
161+
162+
yamllint:
163+
name: 'Lint Yaml'
164+
runs-on: ubuntu-latest
165+
166+
steps:
167+
- name: Checkout code
168+
uses: actions/checkout@v3
169+
170+
# Ref: https://yamllint.readthedocs.io/en/stable/
171+
- name: Run Yamllint on all yaml files in repo
172+
run: yamllint . --format colored
173+
174+
- name: Pipe Yamllint results on to GH for inline display
175+
if: ${{ failure() }}
176+
run: yamllint . --format github

.github/workflows/quicktest.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ jobs:
6464
if: matrix.php != 'latest'
6565
uses: "ramsey/composer-install@v2"
6666
with:
67-
# Bust the cache at least once a month - output format: YYYY-MM-DD.
68-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
67+
# Bust the cache at least once a month - output format: YYYY-MM.
68+
custom-cache-suffix: $(date -u "+%Y-%m")
6969

70-
# For the PHP "latest", we need to install with ignore platform reqs as not all PHPUnit 7.x dependencies allow it.
70+
# For PHP "latest", we need to install with ignore platform reqs as not all PHPUnit 7.x dependencies allow it.
7171
- name: Install Composer dependencies - with ignore platform
7272
if: matrix.php == 'latest'
7373
uses: "ramsey/composer-install@v2"
7474
with:
7575
composer-options: --ignore-platform-reqs
76-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
76+
custom-cache-suffix: $(date -u "+%Y-%m")
7777

7878
- name: Lint against parse errors
7979
if: matrix.phpcs_version == 'dev-master'

.github/workflows/test.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ jobs:
3232
# @link https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix
3333
#
3434
# The matrix is set up so as not to duplicate the builds which are run for code coverage.
35-
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '8.0', '8.1', '8.2']
35+
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '8.0', '8.1', '8.2', '8.3']
3636
phpcs_version: ['3.7.1', 'dev-master']
3737

3838
name: "Test${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
3939

40+
continue-on-error: ${{ matrix.php == '8.3' }}
41+
4042
steps:
4143
- name: Checkout code
4244
uses: actions/checkout@v3
@@ -68,16 +70,16 @@ jobs:
6870
if: ${{ startsWith( matrix.php, '8' ) == false }}
6971
uses: "ramsey/composer-install@v2"
7072
with:
71-
# Bust the cache at least once a month - output format: YYYY-MM-DD.
72-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
73+
# Bust the cache at least once a month - output format: YYYY-MM.
74+
custom-cache-suffix: $(date -u "+%Y-%m")
7375

7476
# For the PHP 8/"nightly", we need to install with ignore platform reqs as we're still using PHPUnit 7.
7577
- name: Install Composer dependencies - with ignore platform
7678
if: ${{ startsWith( matrix.php, '8' ) }}
7779
uses: "ramsey/composer-install@v2"
7880
with:
7981
composer-options: --ignore-platform-reqs
80-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
82+
custom-cache-suffix: $(date -u "+%Y-%m")
8183

8284
- name: Lint against parse errors
8385
if: matrix.phpcs_version == 'dev-master'
@@ -144,8 +146,8 @@ jobs:
144146
- name: Install Composer dependencies
145147
uses: "ramsey/composer-install@v2"
146148
with:
147-
# Bust the cache at least once a month - output format: YYYY-MM-DD.
148-
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
149+
# Bust the cache at least once a month - output format: YYYY-MM.
150+
custom-cache-suffix: $(date -u "+%Y-%m")
149151

150152
- name: Lint against parse errors
151153
if: matrix.phpcs_version == 'dev-master'

.remarkignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore rules for Remark.
2+
# Docs: https://github.com/unifiedjs/unified-engine/blob/HEAD/doc/ignore.md
3+
4+
/node_modules/
5+
/vendor/

.remarkrc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"plugins": [
3+
"remark-gfm",
4+
["remark-lint-checkbox-character-style", "consistent"],
5+
["remark-lint-checkbox-content-indent", "consistent"],
6+
"remark-lint-definition-spacing",
7+
"remark-lint-file-extension",
8+
["remark-lint-linebreak-style", "unix"],
9+
["remark-lint-link-title-style", "\""],
10+
["remark-lint-ordered-list-marker-style", "."],
11+
"remark-lint-no-duplicate-defined-urls",
12+
"remark-lint-no-duplicate-definitions",
13+
"remark-lint-no-empty-url",
14+
"remark-lint-no-file-name-consecutive-dashes",
15+
"remark-lint-no-file-name-irregular-characters",
16+
"remark-lint-no-file-name-outer-dashes",
17+
"remark-lint-no-heading-like-paragraph",
18+
"remark-lint-no-literal-urls",
19+
"remark-lint-no-reference-like-url",
20+
"remark-lint-no-shortcut-reference-image",
21+
"remark-lint-no-table-indentation",
22+
"remark-lint-no-undefined-references",
23+
"remark-lint-no-unneeded-full-reference-image",
24+
"remark-lint-no-unneeded-full-reference-link",
25+
"remark-lint-no-unused-definitions",
26+
["remark-lint-strikethrough-marker", "~~"],
27+
["remark-lint-table-cell-padding", "consistent"],
28+
"remark-lint-heading-whitespace",
29+
"remark-lint-list-item-punctuation",
30+
"remark-lint-match-punctuation",
31+
"remark-lint-no-hr-after-heading",
32+
"remark-lint-are-links-valid-alive",
33+
"remark-lint-are-links-valid-duplicate",
34+
"remark-validate-links"
35+
]
36+
}

.yamllint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Details on the default config:
2+
# https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
3+
extends: default
4+
5+
yaml-files:
6+
- '*.yaml'
7+
- '*.yml'
8+
- '.yamllint'
9+
10+
# Rule documentation: https://yamllint.readthedocs.io/en/stable/rules.html
11+
rules:
12+
colons:
13+
max-spaces-after: -1 # Disabled to allow aligning of values.
14+
comments:
15+
min-spaces-from-content: 1
16+
comments-indentation: {}
17+
document-start:
18+
present: false
19+
line-length:
20+
max: 145
21+
truthy:
22+
allowed-values: ["true", "false", "on", "off"]

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,38 @@ This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses
1515
_Nothing yet._
1616

1717

18+
## [1.0.0] - 2023-01-04
19+
20+
:warning: Important: this package now requires [PHPCSUtils 1.0.0]. Please make sure you use `--with-[all-]dependencies` when running `composer update`. :exclamation:
21+
22+
For the full list of features, please see the changelogs of the alpha/rc releases:
23+
* [1.0.0-rc1](https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.0.0-rc1)
24+
* [1.0.0-alpha3](https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.0.0-alpha3)
25+
* [1.0.0-alpha2](https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.0.0-alpha2)
26+
* [1.0.0-alpha1](https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.0.0-alpha1)
27+
28+
### Changed
29+
30+
#### Other
31+
32+
* Updated various sniffs to take advantage of PHPCSUtils 1.0.0(-rc1). [#193], [#194], [#195]
33+
* Minor documentation improvements.
34+
* Various housekeeping.
35+
36+
### Fixed
37+
38+
#### Modernize
39+
40+
* `Modernize.FunctionCalls.Dirname`: the sniff will now correctly recognize magic constants in a case-insensitive manner. [#187]
41+
42+
[PHPCSUtils 1.0.0]: https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.0
43+
44+
[#187]: https://github.com/PHPCSStandards/PHPCSExtra/pull/187
45+
[#193]: https://github.com/PHPCSStandards/PHPCSExtra/pull/193
46+
[#194]: https://github.com/PHPCSStandards/PHPCSExtra/pull/194
47+
[#195]: https://github.com/PHPCSStandards/PHPCSExtra/pull/195
48+
49+
1850
## [1.0.0-RC1] - 2022-12-07
1951

2052
:warning: Important: this package now requires [PHPCSUtils 1.0.0-alpha4]. Please make sure you use `--with-[all-]dependencies` when running `composer update`. :exclamation:
@@ -137,6 +169,7 @@ The upgrade to PHPCSUtils 1.0.0-alpha4 took care of a number of bugs, which pote
137169
[#128]: https://github.com/PHPCSStandards/PHPCSExtra/pull/128
138170
[#130]: https://github.com/PHPCSStandards/PHPCSExtra/pull/130
139171
[#134]: https://github.com/PHPCSStandards/PHPCSExtra/pull/134
172+
[#135]: https://github.com/PHPCSStandards/PHPCSExtra/pull/135
140173
[#137]: https://github.com/PHPCSStandards/PHPCSExtra/pull/137
141174
[#140]: https://github.com/PHPCSStandards/PHPCSExtra/pull/140
142175
[#142]: https://github.com/PHPCSStandards/PHPCSExtra/pull/142
@@ -342,6 +375,7 @@ This initial alpha release contains the following sniffs:
342375
[Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer
343376

344377
[Unreleased]: https://github.com/PHPCSStandards/PHPCSExtra/compare/stable...HEAD
378+
[1.0.0]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-rc1...1.0.0
345379
[1.0.0-RC1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-alpha3...1.0.0-rc1
346380
[1.0.0-alpha3]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-alpha2...1.0.0-alpha3
347381
[1.0.0-alpha2]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-alpha1...1.0.0-alpha2

Modernize/Sniffs/FunctionCalls/DirnameSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function process(File $phpcsFile, $stackPtr)
118118
/*
119119
* PHP 5.3+: Detect use of dirname(__FILE__).
120120
*/
121-
if ($pathParam['clean'] === '__FILE__') {
121+
if (\strtoupper($pathParam['clean']) === '__FILE__') {
122122
// Determine if the issue is auto-fixable.
123123
$hasComment = $phpcsFile->findNext(Tokens::$commentTokens, ($opener + 1), $closer);
124124
$fixable = ($hasComment === false);

0 commit comments

Comments
 (0)