Skip to content

Commit aa1a503

Browse files
authored
Merge pull request #47
Workshop session fixes
2 parents 0ebb751 + 0aceb1e commit aa1a503

36 files changed

+1365
-145
lines changed

.gitattributes

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44
# https://blog.madewithlove.be/post/gitattributes/
55
# Taken from WPCS https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/
66
/.github export-ignore
7-
/.phpcs.xml.dist export-ignore
7+
/.gitattributes export-ignore
8+
/.gitignore export-ignore
9+
/phpcs.xml.dist export-ignore
10+
/phpcs.xml.dist.sample export-ignore
811
/phpunit.xml.dist export-ignore
912

1013
/Eightshift/Tests export-ignore
1114
/Tests export-ignore
1215

16+
/CODE_OF_CONDUCT.md export-ignore
17+
1318
# Auto detect text files and perform LF normalization
1419
# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/
1520
* text=auto

.github/CONTRIBUTING.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Contributing Guidelines
2+
3+
Welcome to our Eightshift Coding Standards project! Thanks for helping us improve them.
4+
5+
## How can I contribute?
6+
7+
There are multiple ways in which you can help us make this project even better.
8+
9+
- Writing code improvements
10+
- Adding tests
11+
- Writing documentation
12+
- Taking part in the [discussions](https://github.com/infinum/eightshift-coding-standards/discussions)
13+
14+
## Contributing patches and new features
15+
16+
If you found a bug and want to fix it, or you want to add some new and cool feature, [fork](https://github.com/infinum/eightshift-coding-standards) our repository, then create a `feature` branch from the `main` branch. For instance `feature/some-bug-fix` or `feature/some-cool-new-feature`.
17+
18+
Once you've coded things up, be sure you check that your code is following our coding standards. You can do that by running
19+
20+
```bash
21+
composer standards:check
22+
```
23+
24+
Also, test that your code isn't breaking anything by running
25+
26+
```bash
27+
composer tests:run
28+
```
29+
30+
If you want to add a new sniff, please add a documentation for it as well. If you forget to add it the
31+
32+
```bash
33+
composer check:complete-strict
34+
```
35+
36+
will warn you about it.
37+
38+
Then submit a pull request to `develop` branch. Once we check everything we'll merge the changes into the `main` branch with correct version correction (noted by the milestone flag and `future release` tag).
39+
40+
## Guidelines
41+
42+
- We want to ensure a welcoming environment for everyone. With that in mind, all contributors are expected to follow our [Code of Conduct](/CODE_OF_CONDUCT.md).
43+
44+
- You maintain copyright over any contribution you make. By submitting a pull request you agree to release that code under the project's [License](/LICENSE).
45+
46+
## Reporting Security Issues
47+
48+
Please see [SECURITY.md](/SECURITY.md).
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Bug report
2+
description: Report a potential bug with the project
3+
labels: bug
4+
assignees: @dingo-d
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Hi there! We see that you like our project and you have found a bug. This means a lot to us because it helps us to improve it even more :)
10+
11+
- type: textarea
12+
attributes:
13+
label: Describe your bug
14+
description: Please write a clear and concise description of what the bug is.
15+
placeholder: |
16+
Example. When I try to do this, I get this and it should be this...
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
attributes:
22+
label: Steps to Reproduce
23+
description: Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, that means a lot to us.
24+
placeholder: |
25+
1.
26+
2.
27+
3.
28+
4.
29+
validations:
30+
required: true
31+
32+
- type: textarea
33+
attributes:
34+
label: Expected behavior
35+
description: Please write a clear and concise description of what you expected to happen.
36+
placeholder: |
37+
Example. I should get this...
38+
validations:
39+
required: true
40+
41+
- type: textarea
42+
attributes:
43+
label: Screenshots, screen recording, code snippet
44+
description: |
45+
If possible, please upload a screenshot or screen recording which demonstrates your bug.
46+
validations:
47+
required: false
48+
49+
- type: textarea
50+
attributes:
51+
label: Environment info
52+
description: |
53+
Please include as many relevant details about the environment you are working on.
54+
placeholder: |
55+
- PHP version
56+
- PHP_CodeSniffer version
57+
- WPCS version
58+
- Eightshift Coding Standards version
59+
- IDE (if relevant)
60+
validations:
61+
required: false
62+
63+
- type: dropdown
64+
id: existing
65+
attributes:
66+
label: Please confirm that you have searched existing issues in this repo.
67+
description: You can do this by searching https://github.com/infinum/eightshift-coding-standards/issues.
68+
multiple: false
69+
options:
70+
- 'Yes'
71+
- 'No'
72+
validations:
73+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: General help request
4+
url: https://github.com/infinum/eightshift-coding-standards/discussions/categories/general
5+
about: For general help requests, create a new topic in the General discussion forum
6+
- name: Q&A
7+
url: https://github.com/infinum/eightshift-coding-standards/discussions/categories/q-a
8+
about: For more technical help requests, create a new topic in the Q&A discussion forum
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Feature request
2+
description: Suggest a new sniff for these coding standards
3+
labels: feature request
4+
assignees: @dingo-d
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Hi there! We see that you like our project and you have some ideas. This means a lot to us because it helps us to improve it even more :)
10+
- type: textarea
11+
attributes:
12+
label: Describe your feature request
13+
description: Please write a clear and concise description of what the problem is.
14+
placeholder: |
15+
Example. I'm always frustrated when...
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
attributes:
21+
label: Describe the solution you'd like
22+
description: Please write a clear and concise description of what you want to happen.
23+
placeholder: |
24+
Example. With this feature I will be able to...
25+
validations:
26+
required: true
27+
28+
- type: dropdown
29+
id: existing
30+
attributes:
31+
label: Please confirm that you have searched existing issues and discussions about this feature.
32+
description: You can do this by searching https://github.com/infinum/eightshift-coding-standards/issues and https://github.com/infinum/eightshift-coding-standards/discussions.
33+
multiple: false
34+
options:
35+
- 'Yes'
36+
- 'No'
37+
validations:
38+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Description
2+
<!-- Please describe what you have changed or added -->
3+
4+
## Types of changes
5+
<!-- What types of changes does your code introduce? -->
6+
<!-- Bug fix (non-breaking change which fixes an issue) -->
7+
<!-- New feature (non-breaking change which adds functionality) -->
8+
<!-- Breaking change (fix or feature that would cause existing functionality to not work as expected) -->
9+
10+
## Checklist:
11+
- [ ] My code is tested.
12+
- [ ] My code follows the code style set by the project.
13+
- [ ] I've included sniff documentation.

.github/workflows/lint.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
# Allow manually triggering the workflow.
88
workflow_dispatch:
99

10+
# Cancels all previous workflow runs for the same branch that have not yet completed.
11+
concurrency:
12+
# The concurrency group contains the workflow name and the branch name.
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1016
jobs:
1117
#### PHP LINT STAGE ####
1218
# Linting against high/low of each PHP major should catch everything.
@@ -37,7 +43,7 @@ jobs:
3743
# Install dependencies and handle caching in one go.
3844
# @link https://github.com/marketplace/actions/install-composer-dependencies
3945
- name: Install Composer dependencies
40-
uses: ramsey/composer-install@v1
46+
uses: ramsey/composer-install@v2
4147

4248
- name: Lint against parse errors
4349
run: composer lint:ci | cs2pr

.github/workflows/ruleset-checks-sniffs.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
# Allow manually triggering the workflow.
77
workflow_dispatch:
88

9+
# Cancels all previous workflow runs for the same branch that have not yet completed.
10+
concurrency:
11+
# The concurrency group contains the workflow name and the branch name.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
915
jobs:
1016
# Performs some code-style related checks.
1117
#
@@ -45,7 +51,7 @@ jobs:
4551
run: composer require squizlabs/php_codesniffer:"dev-master" --no-update --no-scripts
4652

4753
- name: Install Composer dependencies
48-
uses: ramsey/composer-install@v1
54+
uses: ramsey/composer-install@v2
4955

5056
- name: Install xmllint
5157
run: sudo apt-get install libxml2-utils
@@ -122,7 +128,7 @@ jobs:
122128
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts
123129

124130
- name: Install Composer dependencies
125-
uses: ramsey/composer-install@v1
131+
uses: ramsey/composer-install@v2
126132

127133
- name: Test the Eightshift ruleset
128134
run: composer tests:checkcs

.github/workflows/sniff.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
# Allow manually triggering the workflow.
88
workflow_dispatch:
99

10+
# Cancels all previous workflow runs for the same branch that have not yet completed.
11+
concurrency:
12+
# The concurrency group contains the workflow name and the branch name.
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1016
env:
1117
XMLLINT_INDENT: ' '
1218

@@ -38,7 +44,7 @@ jobs:
3844
# Install dependencies and handle caching in one go.
3945
# @link https://github.com/marketplace/actions/install-composer-dependencies
4046
- name: Install Composer dependencies
41-
uses: ramsey/composer-install@v1
47+
uses: ramsey/composer-install@v2
4248

4349
- name: Install xmllint
4450
run: sudo apt-get install --no-install-recommends -y libxml2-utils

.github/workflows/test.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ on:
99
# Allow manually triggering the workflow.
1010
workflow_dispatch:
1111

12+
# Cancels all previous workflow runs for the same branch that have not yet completed.
13+
concurrency:
14+
# The concurrency group contains the workflow name and the branch name.
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1218
jobs:
1319
tests:
1420
name: PHP ${{ matrix.php }} with PHPCS ${{ matrix.phpcs_branch }}/WPCS ${{ matrix.wpcs_branch }}
@@ -30,17 +36,6 @@ jobs:
3036
wpcs_branch: 'dev-master'
3137
include:
3238
# Complete the matrix.
33-
# PHPCS 3.5.0 is the lowest PHPCS version (runtime) compatible with PHP 7.4.
34-
# PHPCS 3.5.7 is the lowest PHPCS version (runtime) compatible with PHP 8.0.
35-
- php: '7.4'
36-
phpcs_branch: 'dev-master'
37-
wpcs_branch: 'dev-master'
38-
allowed_failure: false
39-
- php: '7.4'
40-
phpcs_branch: '3.5.0'
41-
wpcs_branch: '2.3.0'
42-
allowed_failure: false
43-
4439
# Compliment the matrix with some additional builds.
4540
# Separate test builds for PHP 7.2 with reversed PHPCS vs WPCS branches.
4641
- php: '7.2'
@@ -97,11 +92,11 @@ jobs:
9792
# Once we'll support PHP 8 this will come in handy.
9893
- name: Install Composer dependencies
9994
if: ${{ matrix.php < 8.0 }}
100-
uses: ramsey/composer-install@v1
95+
uses: ramsey/composer-install@v2
10196

10297
- name: Install Composer dependencies
10398
if: ${{ matrix.php >= 8.0 }}
104-
uses: ramsey/composer-install@v1
99+
uses: ramsey/composer-install@v2
105100
with:
106101
composer-options: --ignore-platform-reqs
107102

0 commit comments

Comments
 (0)