Code Monkey home page Code Monkey logo

Comments (1)

aarongoldenthal avatar aarongoldenthal commented on June 17, 2024

After thinking about this a little, if pa11y-ci were updated to simply write the value returned from a reporter to stdout, as pa11y does (in most cases), then it would do the same for all analyzed files. The results could be piped to a file, but the result wouldn't be valid for the given format (excluding cli for the moment, and technically tsv and csv would but would have headers repeated for every file).

An alternative proposal - create a new reporter that's essentially a shim for using any pa11y reporter:

  • Assume one reporter, requiring configuration to specify the pa11y reporter
  • This reporter would take the output from the specified pa11y reporter results function, create a unique file name based on the URL, and save the results to the file (which would then be valid for the given format)
  • The reporter configuration could also include a destination directory
  • My original thought was exclude the cli reporter, although it could be used, but would probably want to strip out the ANSI escape codes
  • For errors, the output from the reporter error function would be written to stderr

For the pa11y reporters:

  • The csv, html, and tsv reporters would work with the above implementation
  • The json reporter writes to stdout, but could be changed to simply return the results, which would then work with the implementation above. Pa11y already writes that output to stdout, so would be functionally transparent to the user.
  • The cli reporter could be updated to write to stdout itself (as the json reporter does now). This would be transparent for pa11y, but would allow the reporter to be used directly with pa11y-ci with the expected output. In this case it is valid and logical output on its own.

from pa11y-ci.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.