You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release v1.5.8: ERB detection, global enable/disable flag, and scanner improvements
- Fixed ERB template detection: headings and buttons with ERB tags no longer flagged as empty
- Added global enabled flag to completely disable all accessibility checks
- Improved scanner behavior: stays alive when disabled instead of exiting
- Enhanced ErbExtractor to preserve ERB content detection
Copy file name to clipboardExpand all lines: CHANGELOG.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,49 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [1.5.8] - 2024-12-01
9
+
10
+
### Fixed
11
+
-**ERB template detection**: Fixed false positives for empty headings and missing accessible names when ERB output tags (`<%= ... %>`) are present
12
+
-**Static scanning**: ERB tags are now replaced with placeholder text so checks can detect that content will be present at runtime
13
+
-**Scanner process management**: Static and live scanners now stay alive (sleep loop) when `enabled: false` instead of exiting, preventing Foreman from killing other processes
14
+
15
+
### Added
16
+
-**Global enable/disable flag**: Added `enabled` configuration option in `accessibility.yml` to completely disable all accessibility checks (manual and automatic)
17
+
-**ERB content detection**: `ErbExtractor` now replaces `<%= ... %>` with `"ERB_CONTENT"` placeholder instead of removing it
18
+
-**ERB-aware checks**: `HeadingCheck` and `InteractiveElementsCheck` now detect ERB placeholders and skip empty checks
19
+
20
+
### Improved
21
+
-**Static scanner behavior**: When `enabled: false`, scanner shows message and keeps running instead of exiting
22
+
-**Live scanner behavior**: When `enabled: false`, scanner shows message and keeps running instead of exiting
23
+
24
+
## [1.5.7] - 2024-12-01
25
+
26
+
### Fixed
27
+
-**Configuration loading**: Improved robustness of `should_auto_run_checks?` method with better error handling and documentation
28
+
-**RSpec integration**: Enhanced configuration priority logic to ensure YAML config is properly respected
29
+
30
+
### Improved
31
+
-**Code documentation**: Added clearer comments explaining configuration priority and behavior
32
+
-**Error handling**: Better handling of edge cases in configuration loading
33
+
34
+
## [1.5.6] - 2024-12-01
35
+
36
+
### Changed
37
+
-**System specs auto-run default**: Changed default `system_specs.auto_run` to `false` in YAML configuration
38
+
-**Breaking change**: Accessibility checks no longer run automatically in system specs by default
39
+
-**Migration**: Users who want automatic checks should set `system_specs.auto_run: true` in their `config/accessibility.yml`
40
+
41
+
### Added
42
+
-**H2 inside button detection**: Added check for headings nested inside button elements (accessibility violation)
43
+
-**Improved view file detection**: Better prioritization of view files vs layout files for error attribution
44
+
-**YAML configuration for system specs**: Added `system_specs.auto_run` configuration option in YAML
45
+
46
+
### Improved
47
+
-**Error reporting**: Improved accuracy of error attribution to correct view files based on Rails HTML structure
48
+
-**Layout detection**: Better detection of layout elements vs yield content (view files)
49
+
-**System spec output**: Reduced terminal clutter by only showing errors, not success messages
Copy file name to clipboardExpand all lines: docs_site/configuration.md
+58-1Lines changed: 58 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,15 @@ static_scanner:
51
51
# Force full scan on startup (true/false)
52
52
full_scan_on_startup: true
53
53
54
+
# System specs configuration
55
+
# Controls behavior of accessibility checks in RSpec system specs
56
+
system_specs:
57
+
# Automatically run accessibility checks after each system spec (true/false)
58
+
# When true, checks run automatically after each `visit` in system specs
59
+
# When false, checks only run when explicitly called (e.g., check_comprehensive_accessibility)
60
+
# Can be overridden per-profile (see profile sections below)
61
+
auto_run: true
62
+
54
63
# Global check configuration
55
64
# Set to false to disable a check globally
56
65
checks:
@@ -79,14 +88,20 @@ You can define different configurations for different environments:
79
88
development:
80
89
checks:
81
90
color_contrast: false # Skip in dev for speed
91
+
# system_specs:
92
+
# auto_run: false # Disable auto-run in development for faster tests
82
93
83
94
test:
84
95
checks:
85
96
# Test environment uses global settings by default
97
+
# system_specs:
98
+
# auto_run: true # Enable auto-run in test (default)
86
99
87
100
ci:
88
101
checks:
89
102
color_contrast: true # Full checks in CI
103
+
# system_specs:
104
+
# auto_run: true # Always run in CI
90
105
```
91
106
92
107
To run a specific profile:
@@ -111,15 +126,57 @@ ignored_rules:
111
126
112
127
---
113
128
129
+
## System Specs Configuration
130
+
131
+
Control whether accessibility checks run automatically in system specs:
132
+
133
+
```yaml
134
+
# config/accessibility.yml
135
+
system_specs:
136
+
auto_run: true # Run checks automatically (default: true)
137
+
```
138
+
139
+
**When `auto_run: true`** (default):
140
+
- Checks run automatically after each `visit` in system specs
141
+
- No need to manually call `check_comprehensive_accessibility`
142
+
- Great for continuous testing
143
+
144
+
**When `auto_run: false`**:
145
+
- Checks only run when explicitly called
146
+
- Use `check_comprehensive_accessibility` in your specs
147
+
- Useful when you want more control over when checks run
148
+
149
+
**Profile-specific overrides:**
150
+
151
+
```yaml
152
+
development:
153
+
system_specs:
154
+
auto_run: false # Disable in development for faster tests
155
+
156
+
test:
157
+
system_specs:
158
+
auto_run: true # Always run in test environment
159
+
160
+
ci:
161
+
system_specs:
162
+
auto_run: true # Always run in CI
163
+
```
164
+
165
+
**Note:** YAML configuration takes precedence over the Ruby initializer configuration. If `system_specs.auto_run` is set in YAML, it will override `config.auto_run_checks` from the initializer.
166
+
167
+
---
168
+
114
169
## Ruby Configuration
115
170
116
171
For advanced setup (like changing the logger), create an initializer:
117
172
118
173
```ruby
119
174
# config/initializers/rails_a11y.rb
120
175
RailsAccessibilityTesting.configure do |config|
121
-
config.auto_run_checks = true
176
+
config.auto_run_checks = true # Note: Can be overridden by YAML config
122
177
config.logger = Rails.logger
123
178
config.default_profile = :test
124
179
end
125
180
```
181
+
182
+
**Important:** The YAML `system_specs.auto_run` setting takes precedence over `config.auto_run_checks` from the initializer. Use YAML for environment-specific control.
0 commit comments