Skip to content

Commit 59fc0b8

Browse files
jmnoteclaude
andauthored
Add dev tooling: composer, phpcs, Makefile, CI, .gitignore (#71)
- composer.json: mediawiki-codesniffer, minus-x, php-parallel-lint as require-dev, wired up via `composer test` - .phpcs.xml: MediaWiki coding-standard ruleset (excluding hack/, tests/, and the FunctionComment doc-required-for-public/private sniffs) - Makefile: `make checks` (test + phpcs) mirrors what CI runs; `make test` currently runs tests/QuotesTest.php. The mathjax/screenshots targets land later, alongside the hack/ scripts they call. - .github/workflows/pull-request.yml replaces contributors.yml: runs `composer install` + `make checks` on every PR - .gitignore (vendor/, node_modules/, composer.lock, hack/demo/temp/) and .vscode/ editor settings; drops .editorconfig, superseded by phpcs - Drops README's auto-generated Contributors table along with contributors.yml, the workflow that kept it updated — left in place it would just be a stale, frozen snapshot from here on Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 9859f63 commit 59fc0b8

10 files changed

Lines changed: 84 additions & 173 deletions

File tree

.editorconfig

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/contributors.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/pull-request.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: pull-request
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
php:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: '8.3'
16+
17+
- run: composer install --no-progress
18+
19+
- run: make checks

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
vendor/
3+
composer.lock
4+
hack/demo/temp/

.phpcs.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0"?>
2+
<ruleset>
3+
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
4+
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
5+
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
6+
</rule>
7+
<file>.</file>
8+
<exclude-pattern>\.stubs/</exclude-pattern>
9+
<exclude-pattern>hack/</exclude-pattern>
10+
<exclude-pattern>tests/</exclude-pattern>
11+
<arg name="extensions" value="php"/>
12+
<arg name="encoding" value="UTF-8"/>
13+
</ruleset>

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"wongjn.php-sniffer"
4+
]
5+
}

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"[php]": {
3+
"editor.defaultFormatter": "wongjn.php-sniffer",
4+
"editor.formatOnSave": true,
5+
},
6+
"phpSniffer.executablesFolder": "vendor/bin/"
7+
}

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.PHONY: checks test phpcs
2+
3+
checks: test phpcs ## Everything CI runs before merging (needs `composer install`, PHP >= 8.2)
4+
5+
test: ## Run the pure-PHP test suites
6+
php tests/QuotesTest.php
7+
8+
phpcs: ## parallel-lint + minus-x + phpcs against the MediaWiki coding standard
9+
composer test

README.md

Lines changed: 0 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -101,143 +101,3 @@ $wgHooks['SimpleMathJaxAttributes'][]
101101
};
102102
```
103103

104-
## Contributors
105-
106-
<!-- readme: collaborators,contributors -start -->
107-
<table>
108-
<tbody>
109-
<tr>
110-
<td align="center">
111-
<a href="https://github.com/jmnote">
112-
<img src="https://avatars.githubusercontent.com/u/2242405?v=4" width="48;" alt="jmnote"/>
113-
<br />
114-
<sub><b>jmnote</b></sub>
115-
</a>
116-
</td>
117-
<td align="center">
118-
<a href="https://github.com/jamesmontalvo3">
119-
<img src="https://avatars.githubusercontent.com/u/716482?v=4" width="48;" alt="jamesmontalvo3"/>
120-
<br />
121-
<sub><b>James Montalvo</b></sub>
122-
</a>
123-
</td>
124-
<td align="center">
125-
<a href="https://github.com/hexmode">
126-
<img src="https://avatars.githubusercontent.com/u/43581?v=4" width="48;" alt="hexmode"/>
127-
<br />
128-
<sub><b>Mark A. Hershberger</b></sub>
129-
</a>
130-
</td>
131-
<td align="center">
132-
<a href="https://github.com/dummy-index">
133-
<img src="https://avatars.githubusercontent.com/u/3407906?v=4" width="48;" alt="dummy-index"/>
134-
<br />
135-
<sub><b>dummy-index</b></sub>
136-
</a>
137-
</td>
138-
<td align="center">
139-
<a href="https://github.com/lakejason0">
140-
<img src="https://avatars.githubusercontent.com/u/36039861?v=4" width="48;" alt="lakejason0"/>
141-
<br />
142-
<sub><b>lakejason0</b></sub>
143-
</a>
144-
</td>
145-
<td align="center">
146-
<a href="https://github.com/badshah400">
147-
<img src="https://avatars.githubusercontent.com/u/3532467?v=4" width="48;" alt="badshah400"/>
148-
<br />
149-
<sub><b>Atri Bhattacharya</b></sub>
150-
</a>
151-
</td>
152-
</tr>
153-
<tr>
154-
<td align="center">
155-
<a href="https://github.com/Nikerabbit">
156-
<img src="https://avatars.githubusercontent.com/u/1109395?v=4" width="48;" alt="Nikerabbit"/>
157-
<br />
158-
<sub><b>Niklas Laxström</b></sub>
159-
</a>
160-
</td>
161-
<td align="center">
162-
<a href="https://github.com/cubercsl">
163-
<img src="https://avatars.githubusercontent.com/u/22931465?v=4" width="48;" alt="cubercsl"/>
164-
<br />
165-
<sub><b>cubercsl</b></sub>
166-
</a>
167-
</td>
168-
<td align="center">
169-
<a href="https://github.com/liberaldev">
170-
<img src="https://avatars.githubusercontent.com/u/56965274?v=4" width="48;" alt="liberaldev"/>
171-
<br />
172-
<sub><b>Liberal Dev</b></sub>
173-
</a>
174-
</td>
175-
<td align="center">
176-
<a href="https://github.com/Adnn">
177-
<img src="https://avatars.githubusercontent.com/u/3911163?v=4" width="48;" alt="Adnn"/>
178-
<br />
179-
<sub><b>Adnn</b></sub>
180-
</a>
181-
</td>
182-
<td align="center">
183-
<a href="https://github.com/dexgs">
184-
<img src="https://avatars.githubusercontent.com/u/93449583?v=4" width="48;" alt="dexgs"/>
185-
<br />
186-
<sub><b>Dexter Gaon-Shatford</b></sub>
187-
</a>
188-
</td>
189-
<td align="center">
190-
<a href="https://github.com/pastakhov">
191-
<img src="https://avatars.githubusercontent.com/u/1772774?v=4" width="48;" alt="pastakhov"/>
192-
<br />
193-
<sub><b>Pavel Astakhov</b></sub>
194-
</a>
195-
</td>
196-
</tr>
197-
<tr>
198-
<td align="center">
199-
<a href="https://github.com/v-gar">
200-
<img src="https://avatars.githubusercontent.com/u/11472697?v=4" width="48;" alt="v-gar"/>
201-
<br />
202-
<sub><b>Viktor Garske</b></sub>
203-
</a>
204-
</td>
205-
<td align="center">
206-
<a href="https://github.com/rickselby">
207-
<img src="https://avatars.githubusercontent.com/u/1564517?v=4" width="48;" alt="rickselby"/>
208-
<br />
209-
<sub><b>Rick Selby</b></sub>
210-
</a>
211-
</td>
212-
<td align="center">
213-
<a href="https://github.com/guyru">
214-
<img src="https://avatars.githubusercontent.com/u/1255135?v=4" width="48;" alt="guyru"/>
215-
<br />
216-
<sub><b>guyru</b></sub>
217-
</a>
218-
</td>
219-
<td align="center">
220-
<a href="https://github.com/poiega">
221-
<img src="https://avatars.githubusercontent.com/u/110189813?v=4" width="48;" alt="poiega"/>
222-
<br />
223-
<sub><b>poiega</b></sub>
224-
</a>
225-
</td>
226-
<td align="center">
227-
<a href="https://github.com/vedmaka">
228-
<img src="https://avatars.githubusercontent.com/u/592009?v=4" width="48;" alt="vedmaka"/>
229-
<br />
230-
<sub><b>Vedmaka</b></sub>
231-
</a>
232-
</td>
233-
<td align="center">
234-
<a href="https://github.com/yardenac">
235-
<img src="https://avatars.githubusercontent.com/u/687943?v=4" width="48;" alt="yardenac"/>
236-
<br />
237-
<sub><b>Yardena Cohen</b></sub>
238-
</a>
239-
</td>
240-
</tr>
241-
<tbody>
242-
</table>
243-
<!-- readme: collaborators,contributors -end -->

composer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"require-dev": {
3+
"mediawiki/mediawiki-codesniffer": "52.0.0",
4+
"mediawiki/mediawiki-phan-config": "0.20.0",
5+
"mediawiki/minus-x": "2.0.1",
6+
"php-parallel-lint/php-console-highlighter": "1.0.0",
7+
"php-parallel-lint/php-parallel-lint": "1.4.0"
8+
},
9+
"scripts": {
10+
"fix": [
11+
"minus-x fix .",
12+
"phpcbf"
13+
],
14+
"test": [
15+
"parallel-lint . --exclude vendor --exclude node_modules",
16+
"minus-x check .",
17+
"@phpcs"
18+
],
19+
"phan": "phan -d . --long-progress-bar",
20+
"phpcs": "phpcs -sp"
21+
},
22+
"config": {
23+
"allow-plugins": {
24+
"dealerdirect/phpcodesniffer-composer-installer": true
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)