Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dummy PR to test #17719 #17720

Closed
wants to merge 46 commits into from
Closed

Dummy PR to test #17719 #17720

wants to merge 46 commits into from

Conversation

anomiex
Copy link
Contributor

@anomiex anomiex commented Nov 4, 2020

Changes proposed in this Pull Request:

Do not merge this. It intentionally adds several broken PHP files to
test the workflow being added in PR #17719.

Jetpack product discussion

None.

Does this pull request change what data or activity we track or use?

No.

Testing instructions:

Proposed changelog entry for your changes:

  • None needed. This should never be merged.

Skipped packages/analyzer, there's too much going on there.

The most interesting bit is the switching of abtest to use WorDBless so
it can pick up the WP_Error definition it needs instead of trying to
locally delcare it in its tests which results in a phpcs complaint about
the redefined class.

Also account for two files in the requirelist that had been moved.

I'm tempted to swtich the requirelist to an "excludelist" so we can more
easily exclude things like packages/analyzer and don't have to worry
about tracking new files and renames of files that are supposed to be
clean, but I'll leave that for a future PR.
The end goal is to have all files being fully checked by phpcs. The
progress towards that goal is easier to check when it's "no files are
left in bin/phpcs-excludelist.txt" than when it's "all files are covered
by bin/phpcs-requirelist.js", and it's easier to find work to do when
that work is "clean up a file in excludelist" than "clean up a file
that's not in requirelist".

This also makes things more straightforward when adding new files, as
the default will now be to fully check the files rather than to not
check them but have dangerfile.js try to complain about them.

It also avoids files accidentally falling out of the requirelist if
they're renamed and the requirelist isn't updated.

Plus, the existing requirelist is inaccurate: it claims everything in
packages/ is required, but in practice packages/analyzer/ has never
passed. This change itself won't do anything directly to prevent that
sort of thing in the future, but cleaning it up is necessary if we want
to start having CI run phpcs over the required files.
This makes several changes to the custom scripts available via composer:

* Most of the phpcs-running commands are renamed to be prefixed with
  "phpcs:" rather than "php:". The old names are kept as deprecated
  aliases in all but one case.
* "php:lint" really should lint (`php -l`), not run phpcs.
* Composer always puts vendor/bin/ first in the path, so there's no need
  to include that in all the script definitions.
* Running phpcs via composer can hit composer's 300-second timeout. We
  can avoid that by instructing composer not to apply the timeout.
* Commands can build on others, to avoid repeating mostly the same thing
  (e.g. the timeout disabling) many times.
* We can add documentation for the scripts to the output of
  `composer list`.
@anomiex anomiex added [Type] Bug When a feature is broken and / or not performing as intended [Pri] Low [Status] Wontfix labels Nov 4, 2020
@anomiex anomiex self-assigned this Nov 4, 2020
We seem to be moving away from Travis and to Github Actions. So, this
moves linting and PHPCompatibility out of Travis and into a Github
Action.

This also adds running of the full PHPCS Standard over the non-excluded
files, so we don't regress on them in the future as we have in the past.
--report=checkstyle does XML entity encoding. So let's try
--report=emacs, which doesn't seem to do any escaping.
The anchoring was breaking it.
The full phpcs run will include syntax checking (Generic.PHP.Syntax) and
all of the PHPCompatibility rules that we're already doing separately.
So ignore them for that run to avoid duplicate messages.
There's a space before the `/>` in the `<error>` tag.
@anomiex anomiex force-pushed the dummy/test-pr-17719 branch 5 times, most recently from c65c799 to 1bd167b Compare November 5, 2020 15:23
Semi-arbitrarily chose 5.6, 7.0, 7.4, and 8.0.

Note some lint errors will be detected by multiple versions, and will
therefore show multiple copies of the error in Github. Similarly, errors
caught by both a linter and PHPCompatibility will have both listed.
There should be no need to check deleted files.
Not planning on making this particular job required, but it might be
nice for info.
And fix new issues in two files. Sigh.
If someone creates a branch with a name ending in `.php`, phpcs would
try to check it. We don't want that.
Base automatically changed from try/github-action-for-lint-and-phpcs to master November 30, 2020 21:18
@anomiex anomiex closed this Nov 30, 2020
@anomiex anomiex deleted the dummy/test-pr-17719 branch November 30, 2020 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Pri] Low [Status] Wontfix Touches WP.com Files [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants