Class: Guardrails::A11yAudit
- Inherits:
-
Object
- Object
- Guardrails::A11yAudit
- Defined in:
- lib/guardrails/a11y_audit.rb
Overview
Static a11y checks that don’t require a browser — element-level rules that can be answered from the source. For runtime a11y (color contrast, focus order, ARIA tree, dynamic content) integrate axe-core-rspec alongside Guardrails; see doc/A11Y.md.
Defined Under Namespace
Classes: Finding
Constant Summary collapse
- SCAN_PATTERNS =
[ "app/views/**/*.html.erb", "app/components/**/*.html.erb" ].freeze
- NON_INTERACTIVE_INPUT_TYPES =
%w[hidden submit button reset image].freeze
Instance Method Summary collapse
-
#initialize(root:, output: $stdout) ⇒ A11yAudit
constructor
A new instance of A11yAudit.
- #run ⇒ Object
Constructor Details
Instance Method Details
#run ⇒ Object
31 32 33 34 35 |
# File 'lib/guardrails/a11y_audit.rb', line 31 def run findings = view_files.flat_map { |path| scan_file(path) } print_report(findings) findings end |