-
Notifications
You must be signed in to change notification settings - Fork 122
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
Create tool to validate standalone XEP-0001 conformance #1235
Labels
Editor Tooling
Issue relates to process/tooling
Comments
This was referenced Nov 5, 2022
guusdk
added a commit
to guusdk/xeps
that referenced
this issue
Nov 6, 2022
guusdk
added a commit
to guusdk/xeps
that referenced
this issue
Nov 6, 2022
guusdk
added a commit
to guusdk/xeps
that referenced
this issue
Nov 6, 2022
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.
guusdk
added a commit
to guusdk/xeps
that referenced
this issue
Nov 6, 2022
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.
guusdk
added a commit
to guusdk/xeps
that referenced
this issue
Nov 6, 2022
As per @horazont's feedback: > Whenever you reference a variable ($foobar) and unless you know what you're doing, put it in double quotes.
guusdk
added a commit
to guusdk/xeps
that referenced
this issue
Nov 6, 2022
guusdk
added a commit
to guusdk/xeps
that referenced
this issue
Nov 6, 2022
guusdk
added a commit
to guusdk/xeps
that referenced
this issue
Nov 6, 2022
This adds a check for the usage of the _entity reference_ that is the legal notice.
guusdk
added a commit
to guusdk/xeps
that referenced
this issue
Nov 6, 2022
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.
guusdk
added a commit
to guusdk/xeps
that referenced
this issue
Nov 6, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
While a lot of things are already covered by
xep.dtd
, some more complexrequirements from XEP-0001 need to be checked manually currently. This is
error-prone and should be automated as far as feasible.
Work Proposal
Create a command-line utility which takes a single XEP filename as input (stdin won't work, see below)
Validate the input file against the following criteria
Optional: Check DTD conformance against
xep.dtd
If the filename matches
xep-[0-9]{4}.xml
: check that the number in the filename equals/xep/header/number
(XPath)If the filename does not match
xep-[0-9]{4}.xml
, check:/xep/header/status
(XPath) is ProtoXEP/xep/header/number
(XPath) is literallyXXXX
xep-[0-9]
Check that
/xep/header/status
(XPath) is a defined status (seetools/xeplib.py
for an enum)Check that
/xep/header/type
(XPath) is defined in XEP-0001Check that
/xep/header/approver
(XPath) is either Board or CouncilCheck that the version numbers in the revision blocks are descending (from top to bottom in the document)
If the approver (see above) is Board, enforce that
/xep/header/type
is notStandards Track
.Check that it uses the
xep.xsl
XML stylesheet.Check that it includes the correct legal notice (either by checking for the entity reference, or by checking the content)
The text was updated successfully, but these errors were encountered: