Add dev tooling: composer, phpcs, Makefile, CI, .gitignore - #71
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc720a6a17
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| mathjax: ## Pin the resources/MathJax submodule to a tag, e.g. `make mathjax MATHJAX_VERSION=4.1.3` | ||
| hack/mathjax.sh $(MATHJAX_VERSION) | ||
|
|
||
| screenshots: ## Screenshot a demo page, e.g. `make screenshots directMath` (no demo = every demo in docs/demos.yaml) | ||
| hack/demo/demo.sh screenshot $(filter-out $@,$(MAKECMDGOALS)) |
There was a problem hiding this comment.
Add the helper scripts before exposing these targets
In the reviewed commit's complete tree, neither hack/mathjax.sh nor hack/demo/demo.sh exists (and the referenced docs/demos.yaml is also absent), so make mathjax and make screenshots both fail immediately with exit 127. Add the missing helper assets or remove these targets until their implementations are included.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed — moved the mathjax/screenshots targets to the follow-up PR that actually adds hack/mathjax.sh, hack/demo/demo.sh, and docs/demos.yaml. This PR's Makefile now only has checks/test/phpcs, so make mathjax/make screenshots correctly fail with "No rule to make target" until those scripts land.
| %: | ||
| @: |
There was a problem hiding this comment.
Restrict the catch-all rule to valid screenshot arguments
Because % matches every otherwise unknown goal, any typo such as make cheks executes @: and exits successfully without running the intended checks. This can give developers or automation a false indication that validation completed; pass the demo name through a variable or enumerate valid demo goals instead of accepting every target.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch. Since the catch-all target moves to that same follow-up PR along with mathjax/screenshots, I scoped it there: ifneq ($(filter screenshots,$(MAKECMDGOALS)),) guards the %: rule so it only fires when screenshots is actually one of the invoked goals — make cheks still fails with "No rule to make target" instead of silently no-op'ing.
bc720a6 to
63615d8
Compare
- 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>
63615d8 to
0f00912
Compare
Summary
composer.json:mediawiki/mediawiki-codesniffer,mediawiki/minus-x,php-parallel-lintas require-dev, wired up viacomposer test.phpcs.xml: MediaWiki coding-standard ruleset (excludinghack/,tests/, and the FunctionComment doc-required-for-public/private sniffs)Makefile:make checks(test + phpcs) mirrors what CI runs;make testcurrently runstests/QuotesTest.php.github/workflows/pull-request.ymlreplacescontributors.yml: runscomposer install+make checkson every PR.gitignore(vendor/,node_modules/,composer.lock,hack/demo/temp/) and.vscode/editor settings.editorconfig, superseded by phpcscontributors.yml, the workflow that kept it updated — left in place it would just be a stale, frozen snapshot from here onTests
Passes:
tests/QuotesTest.php(15 assertions) + phpcs/parallel-lint/minus-x clean against the currentincludes/-namespaced code.🤖 Generated with Claude Code