1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-08-13 16:53:48 -04:00
Commit Graph

12 Commits

Author SHA1 Message Date
Jonas Schäfer
00b5aee816 XEP-0001 validator: allow xxxx as number 2022-12-20 19:31:09 +01:00
Guus der Kinderen
fbc0072c92 for #1235: fix incorrect exemption for XEP-0143 2022-11-06 20:31:58 +01:00
Guus der Kinderen
bee4c93cd3 for #1235: Do not exit script when XPATH yields no result
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.
2022-11-06 20:08:15 +01:00
Guus der Kinderen
028fd1a685 for #1235: Add legal notice validation
This adds a check for the usage of the _entity reference_ that is the legal notice.
2022-11-06 19:20:34 +01:00
Guus der Kinderen
56cef32c91 for #1235: Add header type validation. 2022-11-06 11:11:13 +01:00
Guus der Kinderen
da76032e24 for #1235: Add revision block version validation. 2022-11-06 10:40:02 +01:00
Guus der Kinderen
269e4d620a for #1235: Add xep.xsl XML stylesheet usage validation 2022-11-06 10:14:54 +01:00
Guus der Kinderen
3f6f199159 for #1235: variable casing to conform to convention 2022-11-06 09:45:33 +01:00
Guus der Kinderen
f1197f143a for #1235: Double quote to prevent globbing and word splitting.
As per @horazont's feedback:
> Whenever you reference a variable ($foobar) and unless you know what you're doing, put it in double quotes.
2022-11-06 09:40:32 +01:00
Guus der Kinderen
7389c8a3e9 for #1235: Remove redundant braces in if-expression
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.
2022-11-06 09:33:59 +01:00
Guus der Kinderen
d65a5b4c2f for #1235: Use set -euo pipefail instead of set -e
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.
2022-11-06 09:29:18 +01:00
Guus der Kinderen
a7149be8c0 fixes #1235: Script that validates XEP-0001 conformance
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
2022-11-05 16:53:26 +01:00