Skip to content

Commit 85b4572

Browse files
xxsimoxxxxsimoxx
andauthored
Refactor code to comply with wpcs (#35)
* Rename files * Apply phpcbf * Fix phpcs * Add wpcs workflow * Use ClassicPress standards * Add badges --------- Co-authored-by: xxsimoxx <simone@gieffeedizioni.it>
1 parent 6ab53a6 commit 85b4572

24 files changed

+1873
-1683
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.gitattributes export-ignore
22
.github export-ignore
3-
.gitignore export-ignore
3+
.gitignore export-ignore
4+
phpcs.xml.dist export-ignore

.github/workflows/wpcs.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: WPCS checks.
2+
3+
on: [pull_request, push]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
phpcs:
11+
name: WPCS
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: WPCS checks
16+
uses: 10up/wpcs-action@stable
17+
with:
18+
use_local_config: 'true'
19+
enable_warnings: 'true'
20+
extra_args: '-q -n --report-json=./phpcs.json'
21+
- name: Update summary
22+
run: |
23+
npm i -g github:10up/phpcs-json-to-md
24+
phpcs-json-to-md --path ./phpcs.json --output ./phpcs.md
25+
cat phpcs.md >> $GITHUB_STEP_SUMMARY
26+
if: always()

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# ClassicPress Directory integrator.
44

5+
[![ClassicPress Directory Coding Standard checks.](https://github.com/ClassicPress/classicpress-directory-integration/actions/workflows/cpcs.yml/badge.svg)](https://github.com/ClassicPress/classicpress-directory-integration/actions/workflows/cpcs.yml)[![WPCS checks.](https://github.com/ClassicPress/classicpress-directory-integration/actions/workflows/wpcs.yml/badge.svg)](https://github.com/ClassicPress/classicpress-directory-integration/actions/workflows/wpcs.yml)
6+
57
## Features
68

79
- Plugins and themes from [ClassicPress Directory](https://directory.classicpress.net/) now can update as WP.org plugins.

0 commit comments

Comments
 (0)