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

Use pa11y-ci instead of pa11y #294

Merged
merged 3 commits into from
Oct 22, 2024

Conversation

tarek-y-ismail
Copy link

Main improvement: improved readability of logs, as well as "potential" performance improvements due to not having to launch pa11y for each file. In addition, pa11y-ci offers a concurrency option, but that seems to be broken at the moment.

pa11y output:


Welcome to Pa11y

 > Running Pa11y on URL file:///home/tarek/code-projects/mir/doc/build_doc/doc/sphinx/_build/404/index.html

No issues found!


Welcome to Pa11y

 > Running Pa11y on URL file:///home/tarek/code-projects/mir/doc/build_doc/doc/sphinx/_build/search/index.html

No issues found!


Welcome to Pa11y

 > Running Pa11y on URL file:///home/tarek/code-projects/mir/doc/build_doc/doc/sphinx/_build/tutorial/index.html

Results for URL: file:///home/tarek/code-projects/mir/doc/build_doc/doc/sphinx/_build/tutorial/index.html

 • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 3.31:1. Recommendation:  change text colour to #f9fcff.
   ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail
   ├── #installing-mir-on-debian > p > a
   └── <a class="reference external" href="https://tracker.debian.org/pkg/...">https://tracker.debian.org/pkg/mir</a>

pa11y-ci output:

Running Pa11y on 26 URLs:
 > file:///home/tarek/code-projects/mir/doc/build_doc/doc/sphinx/_build/404/index.html - 0 errors
 > file:///home/tarek/code-projects/mir/doc/build_doc/doc/sphinx/_build/search/index.html - 0 errors
 > file:///home/tarek/code-projects/mir/doc/build_doc/doc/sphinx/_build/tutorial/index.html - 0 errors
 > file:///home/tarek/code-projects/mir/doc/build_doc/doc/sphinx/_build/genindex/index.html - 0 errors
 > file:///home/tarek/code-projects/mir/doc/build_doc/doc/sphinx/_build/reference/continuous-integration/index.html - 0 errors
 > file:///home/tarek/code-projects/mir/doc/build_doc/doc/sphinx/_build/reference/kernel_requirements/index.html - 0 errors

...

Errors in file:///home/tarek/code-projects/mir/doc/build_doc/doc/sphinx/_build/reference/introducing_the_miral_api/index.html:

 • This element has insufficient contrast at this conformance level. Expected a
   contrast ratio of at least 4.5:1, but text in this element has a contrast
   ratio of 3.84:1. Recommendation:  change text colour to #bb5400.

   (#codecell0 > span:nth-child(82))

   <span class="o">::</span>

 • This element has insufficient contrast at this conformance level. Expected a
   contrast ratio of at least 4.5:1, but text in this element has a contrast
   ratio of 3.84:1. Recommendation:  change text colour to #bb5400.

   (#codecell0 > span:nth-child(101))

   <span class="o">=</span>

Main improvement: improved readability of logs, as well as "potential"
performance improvements.
@evilnick
Copy link
Contributor

evilnick commented Oct 8, 2024

Thanks. This is a great improvement as the current output isn't fit for purpose IMO

Copy link
Contributor

@evilnick evilnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing I am unclear about is if we need to redefine the targets for this. Can't we just run pa11y-ci on line 108 instead?
The reason being, other tools and processes expect that target to exist

@tarek-y-ismail
Copy link
Author

The only thing I am unclear about is if we need to redefine the targets for this. Can't we just run pa11y-ci on line 108 instead? The reason being, other tools and processes expect that target to exist

A very reasonable request. Does the latest commit address this? I'm not too deep in the Make ecosystem so I might've missed something :)

Copy link
Collaborator

@SecondSkoll SecondSkoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .PHONY targets have changed but not the actual Make commands. Otherwise this all seems fine.

@@ -58,10 +58,10 @@ sp-woke-install:
{ echo "Installing \"woke\" snap... \n"; sudo snap install woke; }

sp-pa11y-install:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sp-pa11y-install:
sp-pa11y-ci-install:

Makefile.sp Outdated
@@ -104,8 +104,8 @@ sp-woke: sp-woke-install
woke $(ALLFILES) --exit-1-on-failure \
-c https://github.com/canonical/Inclusive-naming/raw/main/config.yml

sp-pa11y: sp-pa11y-install sp-html
find $(BUILDDIR) -name *.html -print0 | xargs -n 1 -0 $(PA11Y)
sp-pa11y: sp-pa11y-ci-install sp-html
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sp-pa11y: sp-pa11y-ci-install sp-html
sp-pa11y-ci: sp-pa11y-ci-install sp-html

@tarek-y-ismail
Copy link
Author

I think the better approach would be to revert the phony naming changes instead. I don't know why I forgot them but thanks for pointing that out :)

@SecondSkoll
Copy link
Collaborator

Done and done, thanks @tarek-y-ismail

@SecondSkoll SecondSkoll merged commit af9a5ab into canonical:pre-extension Oct 22, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants