CI: Add docbook-cs linting#5524
Conversation
TimWolla
left a comment
There was a problem hiding this comment.
Some remarks for the workflow definition. Didn't look at the tool itself, but the premise sounds good to me.
TimWolla
left a comment
There was a problem hiding this comment.
Some more quick GHA comments. Will need to think about the git / checkout usage more at a later point.
|
I am planning to merge Docbook-cs in a few days as all feedback has been addressed. Please let me know if there are comments, objections or concerns regarding this new tool. So to say any feedback is welcome. |
c598aa5 to
a3acc00
Compare
a3acc00 to
281502f
Compare
| - name: "Fetch base branch with merge-base" | ||
| working-directory: "${{ matrix.language }}" | ||
| run: | | ||
| git fetch origin ${{ github.base_ref }} --depth=50 |
There was a problem hiding this comment.
I wanted to double-check what github.base_ref does. It is documented as:
The base_ref or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target.
This means that it doesn't do the right thing for the push: trigger. Can you double-check on your fork with by removing the branch restriction on the push: trigger and observing the CI for the feature/docbook-cs branch in your fork?
There was a problem hiding this comment.
I have been doing some tested and that variable is indeed empty on push.
Any thoughts on this commit before I implement it in this PR?
jordikroon@ba77f57
In short. It fallbacks to github.event.before. And github.event.pull_request.base.sha also seems a little bit better as it will just pick the hash instead of the branch name. On push it will compare against the previous commit hash. On PR it will compare against the base sha.
There was a problem hiding this comment.
Can you try ${{ case(github.event_name == 'pull_request', github.event.pull_request.base.sha, github.event_name == 'push', github.event.before, 'INVALID') }} or similar for clarity? Other than that it looks good to me, I particularly add the added shell quoting (that would've been a follow-up request, depending on how your solution would've looked).
As announced here: https://news-web.php.net/php.doc/969388652
See for test implementation: #5510
The sniffer includes:
This also makes check-whitespaces.xml obsolete, as the sniffer will check for that as well.
The sniffer also covers #5445
<simpara>should be used instead of<para><classname>that should use<exceptionname>instead.