Github workflows tend to be verbose. This can make it difficult to determine why a failure occurs.
To help identify causes for validation failures, the output of the XEP-0001 conformance script should have a bit of color to highlight the important bits.
- Add 'for' attribute such that entities can discover what the fallback is for.
- Allow to specify that only one of <subject/> or <body/> is meant as a fallback.
- Allow to specify the part of respective text that is meant as fallback where applicable.
- Don't use encryption example, which should use XEP-0380 instead.
While the existing version says this was rejected by community consensus, since
then the consensus of most implementations is to use PEP directly even though it
was never specified to work, and that the raw-IQ protocol adds complexity. This
update removes the raw-IQ mode and specifies the reuse of PEP.
xmllint will return exit code 10 when an XPATH query finds no matches. With the changes in this commit, the script isn't stopped. Instead, it uses an empty value, which is likely to cause the validation checks (further down in the script) to fail.
As per @horazont's feedback:
> You do not need () around the command in an if. I think that causes a subshell to spawn, the effects of which I'm not certain about.
Further Googling suggests that the exit status of a pipeline is that of the most recently executed foreground pipeline, meaning that the exit code can be used directly in conditional statements.
As per @horazont's feedback: `-u` shouts at you if you use an undefined variable (very useful to catch typos)
and `-o pipefail` improves error handling by also failing if any of the commands in a pipe fail.
This adds a simple bash script that checks if a provided file (filename to be provided as first argument) conforms to XEP-0001.
Expected to be executed from the directory that holds all xep XML files.
Requires one argument: the file name of the xep to be validated, eg:
$ tools/validate-xep0001-conformance.sh xep-0010.xml
exit status will be non-zero upon validation failure.
requires: bash, xmllint