Skip to content

Commit 8cb1a93

Browse files
authored
Merge pull request #358 from PHPCSStandards/develop
Release PHPCSExtra 1.3.1
2 parents 46d08eb + ed06c49 commit 8cb1a93

Some content is hidden

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

43 files changed

+457
-135
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
.coveralls.yml export-ignore
99
.gitattributes export-ignore
1010
.gitignore export-ignore
11+
.markdownlint-cli2.yaml export-ignore
1112
.remarkignore export-ignore
1213
.remarkrc export-ignore
1314
.yamllint.yml export-ignore

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
name: "\U0001F41B Bug report for sniffs"
33
about: I got unexpected behavior and think it is a bug.
4+
title: ''
45

56
---
67

@@ -73,4 +74,5 @@ You should be able to get the version numbers using the `composer info` command.
7374

7475

7576
## Tested Against `develop` branch?
77+
7678
- [ ] I have verified the issue still exists in the `develop` branch of PHPCSExtra.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
name: "\U0001F680 Feature request"
33
about: I have a suggestion (and may want to implement it).
4+
title: ''
5+
46
---
57

68
## Is your feature request related to a problem?

.github/release-checklist.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ PR for tracking changes for the x.x.x release. Target release date: **DOW MONTH
77
### General
88

99
- [ ] Verify, and if necessary, update the allowed version ranges for various dependencies in the `composer.json` - PR #xxx
10+
- [ ] Go through changelog PHPCS looking for updates to the Tokenizer.
11+
Review if there are sniffs which need updating in relation to the Tokenizer changes (support for new PHP syntaxes, bugs fixed etc).
1012
- [ ] Add changelog for the release - PR #xxx
1113
:pencil2: Remember to add a release link at the bottom!
1214
- [ ] Update sniff list in `README` (if applicable) - PR #xxx.
@@ -24,5 +26,6 @@ PR for tracking changes for the x.x.x release. Target release date: **DOW MONTH
2426
- [ ] Fast-forward `develop` to be equal to `stable`
2527

2628
### Publicize
29+
2730
- [ ] Toot about the release.
2831
- [ ] Tweet about the release.

.github/workflows/basics.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ jobs:
136136
with:
137137
phpstanVersion: '2.x'
138138

139+
markdownlint:
140+
name: 'Lint Markdown'
141+
uses: PHPCSStandards/.github/.github/workflows/reusable-markdownlint.yml@main
142+
139143
remark:
140144
name: 'QA Markdown'
141145
uses: PHPCSStandards/.github/.github/workflows/reusable-remark.yml@main
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check PRs for merge conflicts
2+
3+
on:
4+
# Check for new conflicts due to merges.
5+
push:
6+
branches:
7+
- stable
8+
- develop
9+
# Check conflicts in new PRs and for resolved conflicts due to an open PR being updated.
10+
pull_request_target:
11+
types:
12+
- opened
13+
- synchronize
14+
- reopened
15+
16+
jobs:
17+
check-prs:
18+
runs-on: ubuntu-latest
19+
if: github.repository_owner == 'PHPCSStandards'
20+
21+
name: Check PRs for merge conflicts
22+
23+
steps:
24+
- name: Check PRs for merge conflicts
25+
uses: eps1lon/actions-label-merge-conflict@v3
26+
with:
27+
dirtyLabel: "Status: has merge conflict"
28+
repoToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,41 @@ concurrency:
1919
cancel-in-progress: true
2020

2121
jobs:
22+
lint:
23+
if: ${{ github.ref != 'refs/heads/develop' }}
24+
runs-on: ubuntu-latest
25+
26+
strategy:
27+
matrix:
28+
php: ['5.4', '7.0', '7.4', '8.0', '8.4', '8.5']
29+
30+
name: "Lint: PHP ${{ matrix.php }}"
31+
32+
continue-on-error: ${{ matrix.php == '8.5' }}
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
38+
- name: Install PHP
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: ${{ matrix.php }}
42+
ini-file: 'development'
43+
coverage: none
44+
tools: cs2pr
45+
46+
- name: Install Composer dependencies
47+
uses: "ramsey/composer-install@v3"
48+
with:
49+
# For the PHP "nightly", we need to install with ignore platform reqs as not all dependencies may allow it yet.
50+
composer-options: ${{ matrix.php == '8.5' && '--ignore-platform-req=php+' || '' }}
51+
# Bust the cache at least once a month - output format: YYYY-MM.
52+
custom-cache-suffix: $(date -u "+%Y-%m")
53+
54+
- name: "Lint against parse errors"
55+
run: composer lint -- --checkstyle | cs2pr
56+
2257
#### TEST STAGE ####
2358
test:
2459
if: ${{ github.ref != 'refs/heads/develop' }}
@@ -35,7 +70,7 @@ jobs:
3570
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.5']
3671
phpcs_version: ['lowest', 'dev-master']
3772

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

4075
continue-on-error: ${{ matrix.php == '8.5' }}
4176

@@ -74,6 +109,8 @@ jobs:
74109
- name: Install Composer dependencies
75110
uses: "ramsey/composer-install@v3"
76111
with:
112+
# For the PHP "nightly", we need to install with ignore platform reqs as not all dependencies may allow it yet.
113+
composer-options: ${{ matrix.php == '8.5' && '--ignore-platform-req=php+' || '' }}
77114
# Bust the cache at least once a month - output format: YYYY-MM.
78115
custom-cache-suffix: $(date -u "+%Y-%m")
79116

@@ -84,10 +121,6 @@ jobs:
84121
squizlabs/php_codesniffer
85122
phpcsstandards/phpcsutils
86123
87-
- name: Lint against parse errors
88-
if: matrix.phpcs_version == 'dev-master'
89-
run: composer lint
90-
91124
- name: Run the unit tests
92125
run: composer test
93126

@@ -108,7 +141,7 @@ jobs:
108141
php: ['5.4', '8.4']
109142
phpcs_version: ['lowest', 'dev-master']
110143

111-
name: "Coverage${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
144+
name: "Coverage: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
112145

113146
steps:
114147
- name: Checkout code
@@ -131,7 +164,6 @@ jobs:
131164
php-version: ${{ matrix.php }}
132165
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
133166
coverage: xdebug
134-
tools: cs2pr
135167

136168
- name: "Composer: set PHPCS version for tests (master)"
137169
if: ${{ matrix.phpcs_version != 'lowest' }}
@@ -156,10 +188,6 @@ jobs:
156188
squizlabs/php_codesniffer
157189
phpcsstandards/phpcsutils
158190
159-
- name: Lint against parse errors
160-
if: matrix.phpcs_version == 'dev-master'
161-
run: composer lint -- --checkstyle | cs2pr
162-
163191
- name: Run the unit tests with code coverage
164192
run: composer coverage
165193

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build/
2+
node_modules/
23
vendor/
34
/composer.lock
45
/.phpcs.xml

.markdownlint-cli2.yaml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
#
2+
# Configuration file for MarkdownLint-CLI2.
3+
#
4+
# Example file with all options:
5+
# https://github.com/DavidAnson/markdownlint-cli2/blob/main/test/markdownlint-cli2-yaml-example/.markdownlint-cli2.yaml
6+
#
7+
8+
# Do not fix any fixable errors.
9+
fix: false
10+
11+
# Define glob expressions to use (only valid at root).
12+
globs:
13+
- "**/*.md"
14+
- ".github/**/*.md"
15+
16+
# Show found files on stdout (only valid at root)
17+
showFound: true
18+
19+
# Define glob expressions to ignore.
20+
ignores:
21+
- "node_modules/"
22+
- "vendor/"
23+
24+
# Disable inline config comments.
25+
noInlineConfig: true
26+
27+
# Disable progress on stdout (only valid at root).
28+
noProgress: false
29+
30+
# Adjust the configuration for some built-in rules.
31+
# For full information on the options and defaults, see:
32+
# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
33+
config:
34+
######################
35+
# Disable a few rules.
36+
######################
37+
# MD031/blanks-around-fences - Fenced code blocks should be surrounded by blank lines.
38+
MD031: false
39+
# MD032/blanks-around-lists - Lists should be surrounded by blank lines.
40+
MD032: false
41+
42+
##############################
43+
# Customize a few other rules.
44+
##############################
45+
# MD003/heading-style/header-style - Heading style.
46+
MD003:
47+
# Heading style - Always use hashes.
48+
style: "atx"
49+
50+
# MD004/ul-style - Unordered list style.
51+
MD004:
52+
# List style - each level has a different, but consistent symbol.
53+
style: "sublist"
54+
55+
# MD007/ul-indent - Unordered list indentation.
56+
MD007:
57+
indent: 4
58+
# Whether to indent the first level of the list.
59+
start_indented: false
60+
61+
# MD012/no-multiple-blanks - Multiple consecutive blank lines.
62+
MD012:
63+
maximum: 2
64+
65+
# MD013/line-length - Line length.
66+
MD013:
67+
# Number of characters. No need for being too fussy.
68+
line_length: 1000
69+
# Number of characters for headings.
70+
heading_line_length: 100
71+
# Number of characters for code blocks.
72+
code_block_line_length: 100
73+
# Stern length checking (applies to tables, code blocks etc which have their own max line length).
74+
stern: true
75+
76+
# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content.
77+
MD024:
78+
# Only check sibling headings.
79+
siblings_only: true
80+
81+
# MD033/no-inline-html - Inline HTML.
82+
MD033:
83+
# Allowed elements.
84+
allowed_elements:
85+
- div
86+
- details
87+
- summary
88+
- b
89+
- code
90+
- ul
91+
- li
92+
93+
# MD044/proper-names - Proper names should have the correct capitalization.
94+
MD044:
95+
# List of proper names.
96+
names: ["PHPCSUtils", "PHP", "PHP_CodeSniffer", "CodeSniffer", "PHPUnit"]
97+
# Include code blocks.
98+
code_blocks: false
99+
100+
# MD046/code-block-style - Code block style
101+
MD046:
102+
style: "fenced"
103+
104+
# MD048/code-fence-style - Code fence style
105+
MD048:
106+
style: "backtick"
107+
108+
# MD049/emphasis-style - Emphasis style should be consistent
109+
MD049:
110+
style: "underscore"
111+
112+
# MD050/strong-style - Strong style should be consistent
113+
MD050:
114+
style: "asterisk"

0 commit comments

Comments
 (0)