Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@
# https://www.reddit.com/r/PHP/comments/2jzp6k/i_dont_need_your_tests_in_my_production
# https://blog.madewithlove.be/post/gitattributes/
#
/.gitattributes export-ignore
/.gitignore export-ignore
/.github export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/phpunitlte9.xml.dist export-ignore
/phpunit-bootstrap.php export-ignore
/PHPCSDebug/Tests export-ignore
/Tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.github export-ignore
/.markdownlint-cli2.yaml export-ignore
/.remarkignore export-ignore
/.remarkrc export-ignore
/.yamllint.yml export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/phpunitlte9.xml.dist export-ignore
/phpunit-bootstrap.php export-ignore
/PHPCSDebug/Tests export-ignore
/Tests export-ignore

#
# Auto detect text files and perform LF normalization
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,17 @@ jobs:

phpstan:
uses: PHPCSStandards/.github/.github/workflows/reusable-phpstan.yml@main

markdownlint:
name: 'Lint Markdown'
uses: PHPCSStandards/.github/.github/workflows/reusable-markdownlint.yml@main

remark:
name: 'QA Markdown'
uses: PHPCSStandards/.github/.github/workflows/reusable-remark.yml@main

yamllint:
name: 'Lint Yaml'
uses: PHPCSStandards/.github/.github/workflows/reusable-yamllint.yml@main
with:
strict: true
8 changes: 6 additions & 2 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- php: '5.4'
phpcs_version: '3.1.0'

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

steps:
- name: Checkout code
Expand Down Expand Up @@ -98,12 +98,16 @@ jobs:

- name: Grab PHPUnit version
id: phpunit_version
# yamllint disable rule:line-length
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"
# yamllint enable rule:line-length

- name: Determine PHPUnit composer script to use
id: phpunit_script
run: |
if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) || startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then
if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then
echo 'SUFFIX=' >> "$GITHUB_OUTPUT"
elif [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}" == "true" ]; then
echo 'SUFFIX=' >> "$GITHUB_OUTPUT"
else
echo 'SUFFIX=-lte9' >> "$GITHUB_OUTPUT"
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,16 @@ jobs:

- name: Grab PHPUnit version
id: phpunit_version
# yamllint disable rule:line-length
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"
# yamllint enable rule:line-length

- name: Determine PHPUnit composer script to use
id: phpunit_script
run: |
if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) || startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then
if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then
echo 'SUFFIX=' >> "$GITHUB_OUTPUT"
elif [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}" == "true" ]; then
echo 'SUFFIX=' >> "$GITHUB_OUTPUT"
else
echo 'SUFFIX=-lte9' >> "$GITHUB_OUTPUT"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ jobs:
build_dir: 'deploy'
target_branch: 'gh-pages'
keep_history: true
#allow_empty_commit: false # Turn on after verification that it all works as expected.
allow_empty_commit: false
jekyll: true
commit_message: ${{ steps.commit_msg.outputs.MSG }}
dry_run: ${{ steps.base_branch.outputs.BRANCH != 'stable' }}
verbose: ${{ matrix.verbose }}
verbose: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
build/
deploy/
node_modules/
vendor/
composer.lock
.phpcs.xml
Expand Down
121 changes: 121 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#
# Configuration file for MarkdownLint-CLI2.
#
# Example file with all options:
# https://github.com/DavidAnson/markdownlint-cli2/blob/main/test/markdownlint-cli2-yaml-example/.markdownlint-cli2.yaml
#

# Do not fix any fixable errors.
fix: false

# Define glob expressions to use (only valid at root).
globs:
- "**/*.md"
- ".github/**/*.md"

# Show found files on stdout (only valid at root)
showFound: true

# Define glob expressions to ignore.
ignores:
- "node_modules/"
- "vendor/"

# Disable inline config comments.
noInlineConfig: true

# Disable progress on stdout (only valid at root).
noProgress: false

# Adjust the configuration for some built-in rules.
# For full information on the options and defaults, see:
# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
config:
######################
# Disable a few rules.
######################
# MD031/blanks-around-fences - Fenced code blocks should be surrounded by blank lines.
MD031: false
# MD032/blanks-around-lists - Lists should be surrounded by blank lines.
MD032: false

##############################
# Customize a few other rules.
##############################
# MD003/heading-style/header-style - Heading style.
MD003:
# Heading style - Always use hashes.
style: "atx"

# MD004/ul-style - Unordered list style.
MD004:
# List style - each level has a different, but consistent symbol.
style: "sublist"

# MD007/ul-indent - Unordered list indentation.
MD007:
indent: 4
# Whether to indent the first level of the list.
start_indented: false

# MD012/no-multiple-blanks - Multiple consecutive blank lines.
MD012:
maximum: 2

# MD013/line-length - Line length.
MD013:
# Number of characters. No need for being too fussy.
line_length: 1000
# Number of characters for headings.
heading_line_length: 100
# Number of characters for code blocks.
code_block_line_length: 140
# Stern length checking (applies to tables, code blocks etc which have their own max line length).
stern: true

# MD022/blanks-around-headings : Headings should be surrounded by blank lines.
MD022:
# Blank lines above heading
lines_above: [2, 1, 1, 1, 1]
# Blank lines below heading
lines_below: [1, 1, -1, -1, -1]

# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content.
MD024:
# Only check sibling headings.
siblings_only: true

# MD033/no-inline-html - Inline HTML.
MD033:
# Allowed elements.
allowed_elements:
- div
- details
- summary
- b
- code
- ul
- li

# MD044/proper-names - Proper names should have the correct capitalization.
MD044:
# List of proper names.
names: ["PHPDevTools", "PHPCSUtils", "PHP", "PHP_CodeSniffer", "CodeSniffer", "PHPUnit"]
# Include code blocks.
code_blocks: false

# MD046/code-block-style - Code block style
MD046:
style: "fenced"

# MD048/code-fence-style - Code fence style
MD048:
style: "backtick"

# MD049/emphasis-style - Emphasis style should be consistent
MD049:
style: "underscore"

# MD050/strong-style - Strong style should be consistent
MD050:
style: "asterisk"
5 changes: 5 additions & 0 deletions .remarkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore rules for Remark.
# Docs: https://github.com/unifiedjs/unified-engine/blob/HEAD/doc/ignore.md

/node_modules/
/vendor/
46 changes: 46 additions & 0 deletions .remarkrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"plugins": [
"remark-gfm",
["remark-lint-checkbox-character-style", "consistent"],
["remark-lint-checkbox-content-indent", "consistent"],
"remark-lint-definition-spacing",
"remark-lint-file-extension",
["remark-lint-linebreak-style", "unix"],
["remark-lint-link-title-style", "\""],
["remark-lint-ordered-list-marker-style", "."],
[
"remark-lint-no-dead-urls",
{
"skipUrlPatterns": [
"https://packagist.org/packages/phpcsstandards/phpcsdevtools#dev-develop"
],
"deadOrAliveOptions": {
"maxRetries": 3
}
}
],
"remark-lint-no-duplicate-defined-urls",
"remark-lint-no-duplicate-definitions",
"remark-lint-no-empty-url",
"remark-lint-no-file-name-consecutive-dashes",
["remark-lint-no-file-name-irregular-characters", "\\.a-zA-Z0-9_-"],
"remark-lint-no-file-name-outer-dashes",
"remark-lint-no-heading-like-paragraph",
"remark-lint-no-literal-urls",
"remark-lint-no-reference-like-url",
"remark-lint-no-shortcut-reference-image",
"remark-lint-no-table-indentation",
"remark-lint-no-undefined-references",
"remark-lint-no-unneeded-full-reference-image",
"remark-lint-no-unneeded-full-reference-link",
"remark-lint-no-unused-definitions",
["remark-lint-strikethrough-marker", "~~"],
["remark-lint-table-cell-padding", "consistent"],
"remark-lint-heading-whitespace",
"remark-lint-list-item-punctuation",
"remark-lint-match-punctuation",
"remark-lint-no-hr-after-heading",
"remark-lint-are-links-valid-duplicate",
"remark-validate-links"
]
}
23 changes: 23 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Details on the default config:
# https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
extends: default

yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'
- 'phpstan.neon*'

# Rule documentation: https://yamllint.readthedocs.io/en/stable/rules.html
rules:
colons:
max-spaces-after: -1 # Disabled to allow aligning of values.
comments:
min-spaces-from-content: 1
comments-indentation: {}
document-start:
present: false
line-length:
max: 145
truthy:
allowed-values: ["true", "false", "on", "off"]
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Change Log for the PHPCSDevTools standard for PHP Codesniffer
# Change Log for the PHPCSDevTools standard for PHP_CodeSniffer

All notable changes to this project will be documented in this file.

This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses [Semantic Versioning](http://semver.org/).
This projects adheres to [Keep a CHANGELOG](https://keepachangelog.com/) and uses [Semantic Versioning](https://semver.org/).


## [Unreleased]
Expand Down
Loading