Skip to content

Commit 2dde5c3

Browse files
Add markdownlint configuration and fix all linting issues
Adds markdownlint enforcement and documentation standards to the project. Changes: .markdownlint.json - Configuration for markdown linting: - Line length: 120 chars (excludes code blocks and tables) - Enforces blank lines around headings and lists - Requires language specs for fenced code blocks - Standard markdown best practices AGENTS.md - Updated with markdown requirements: - Added "Documentation Standards" section - Instructions for running markdownlint - Added to DO list: lint markdown files before commit - Fixed all linting issues: - Split long lines - Added language specs to code blocks (text, bash) - Converted bold text to proper headings (####) - Proper blank lines around lists and headings AI-CONTRIBUTIONS.md - Fixed all linting issues: - Split long lines for readability - Converted PR titles from bold to proper headings (####) - Added blank lines around sections - Improved document structure All *.md files now pass: npx markdownlint-cli *.md Benefits: - Consistent markdown formatting across the project - Better readability and maintainability - Catches common markdown issues automatically - Standard enforced for human and AI contributors Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent 89bad1f commit 2dde5c3

File tree

3 files changed

+102
-25
lines changed

3 files changed

+102
-25
lines changed

.markdownlint.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"default": true,
3+
"MD013": {
4+
"line_length": 120,
5+
"code_blocks": false,
6+
"tables": false
7+
},
8+
"MD033": false,
9+
"MD041": false
10+
}

AGENTS.md

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,21 @@ Instructions for AI coding agents working on this project.
44

55
## Project Overview
66

7-
This is a Serverspec-based testing framework for validating Docker images. The project tests Node.js Docker images built from custom Dockerfiles by creating containers, running Serverspec tests against them, and cleaning up resources.
7+
This is a Serverspec-based testing framework for validating Docker images.
8+
The project tests Node.js Docker images built from custom Dockerfiles by
9+
creating containers, running Serverspec tests against them, and cleaning up
10+
resources.
811

912
**Tech Stack:**
13+
1014
- Ruby 3.4+ and Ruby 4.0+
1115
- Serverspec 2.43+
1216
- Docker API gem 2.4+
1317
- RSpec 3.13+
1418
- Docker BuildKit
1519

1620
**Current Node.js versions tested:**
21+
1722
- Node.js 22.22.0 (Maintenance LTS)
1823
- Node.js 24.13.0 (Active LTS)
1924

@@ -44,7 +49,7 @@ bundle exec rake --trace
4449

4550
## Project Structure
4651

47-
```
52+
```text
4853
.
4954
├── 22/ # Node.js 22 Dockerfile
5055
├── 24/ # Node.js 24 Dockerfile
@@ -89,6 +94,30 @@ bundle update
8994
# Always remove BUNDLED WITH section from Gemfile.lock for CI compatibility
9095
```
9196

97+
## Documentation Standards
98+
99+
### Markdown Linting
100+
101+
All markdown files must pass markdownlint validation before committing.
102+
103+
```bash
104+
# Check all markdown files
105+
npx markdownlint-cli *.md
106+
107+
# Auto-fix issues where possible
108+
npx markdownlint-cli --fix *.md
109+
```
110+
111+
**Configuration**: See `.markdownlint.json` for project rules.
112+
113+
**Key Rules**:
114+
115+
- Line length: 120 characters max (code blocks excluded)
116+
- Blank lines around headings and lists
117+
- Language specified for fenced code blocks
118+
- No bare URLs (use markdown links)
119+
- Use proper headings (not bold text as headings)
120+
92121
## Testing Instructions
93122

94123
### What Tests Validate
@@ -155,6 +184,7 @@ describe file("/usr/local/bin/node")
155184
### GitHub Actions Matrix
156185

157186
Tests run on:
187+
158188
- Ruby 3.4 (current stable)
159189
- Ruby 4.0 (latest stable)
160190

@@ -171,6 +201,7 @@ Both versions must pass before merge.
171201

172202
- Test all changes locally before committing
173203
- Run full test suite: `bundle exec rake`
204+
- Lint markdown files: `npx markdownlint-cli *.md`
174205
- Keep Node.js versions on LTS releases
175206
- Update README.md when changing versions
176207
- Use version pinning in Gemfile (`~>` operator)
@@ -193,7 +224,7 @@ Both versions must pass before merge.
193224

194225
### Commit Message Format
195226

196-
```
227+
```text
197228
<type>: <short summary>
198229
199230
<detailed description>
@@ -214,7 +245,7 @@ Co-authored-by: <AI agent or human collaborator>
214245

215246
### Example
216247

217-
```
248+
```text
218249
feat: Add Node.js 26 LTS support
219250
220251
- Create 26/Dockerfile with NODE_VERSION=26.x.x
@@ -258,20 +289,24 @@ Tests pass on Ruby 3.4 and 4.0.
258289

259290
### Common Issues
260291

261-
**Tests fail with "container not found"**
292+
#### Tests fail with "container not found"
293+
262294
- Check that Docker daemon is running
263295
- Verify container cleanup in after(:all) block
264296

265-
**Image build fails**
297+
#### Image build fails
298+
266299
- Verify Node.js version exists on nodejs.org
267300
- Check GPG key servers are accessible
268301
- Review Docker BuildKit logs
269302

270-
**Bundler version conflicts**
303+
#### Bundler version conflicts
304+
271305
- Remove BUNDLED WITH section from Gemfile.lock
272306
- Let CI use its native Bundler version
273307

274-
**Performance Issues**
308+
#### Performance Issues
309+
275310
- Ensure Docker BuildKit is enabled
276311
- Verify parallel execution (multitask) is working
277312
- Check if Docker daemon has resource constraints
@@ -297,14 +332,15 @@ bundle exec rspec spec/24/Dockerfile_spec.rb --format documentation
297332

298333
## Resources
299334

300-
- **Serverspec Documentation**: http://serverspec.org/resource_types.html
301-
- **Docker API Gem**: https://github.com/swipely/docker-api
302-
- **Node.js Releases**: https://nodejs.org/en/about/previous-releases
303-
- **Ruby Releases**: https://www.ruby-lang.org/en/downloads/releases/
335+
- **Serverspec Documentation**: <http://serverspec.org/resource_types.html>
336+
- **Docker API Gem**: <https://github.com/swipely/docker-api>
337+
- **Node.js Releases**: <https://nodejs.org/en/about/previous-releases>
338+
- **Ruby Releases**: <https://www.ruby-lang.org/en/downloads/releases/>
304339

305340
## Questions?
306341

307342
When working on this project:
343+
308344
1. Check existing patterns in similar files
309345
2. Run tests locally before committing
310346
3. Review CI output for multi-version compatibility

AI-CONTRIBUTIONS.md

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,83 +6,98 @@ This document tracks improvements made to this project with the assistance of AI
66
77
## Overview
88

9-
Between February 2026, this project underwent a comprehensive modernization effort with AI assistance. The collaboration resulted in 11 merged pull requests that transformed the codebase from having critical bugs and outdated dependencies to being a modern, efficient, and future-proof testing infrastructure.
9+
Between February 2026, this project underwent a comprehensive modernization
10+
effort with AI assistance. The collaboration resulted in 11 merged pull requests
11+
that transformed the codebase from having critical bugs and outdated dependencies
12+
to being a modern, efficient, and future-proof testing infrastructure.
1013

1114
## Improvements Summary
1215

1316
### 🔒 Critical Bug Fixes
1417

15-
**PR #56: Fixed Unsafe Container Cleanup**
18+
#### PR #56: Fixed Unsafe Container Cleanup
19+
1620
- **Issue**: `delete_image` was stopping ALL Docker containers on the system, including unrelated ones
1721
- **Fix**: Updated to only stop containers created from the test image
1822
- **Impact**: Prevented dangerous system-wide container disruptions
1923

2024
### ⚡ Performance Enhancements
2125

22-
**PR #58: Parallel Test Execution**
26+
#### PR #58: Parallel Test Execution
27+
2328
- **Change**: Implemented Rake multitask for parallel test execution
2429
- **Improvement**: ~47% faster test runs (35s → 18s)
2530
- **Method**: Tests run in separate subprocesses with isolated environments
2631

27-
**PR #62: Docker BuildKit**
32+
#### PR #62: Docker BuildKit
33+
2834
- **Change**: Enabled Docker BuildKit for image builds
2935
- **Benefits**: Faster builds, better caching, improved layer management
3036

3137
### 📦 Dependency Updates
3238

33-
**PR #57: Updated Gem Dependencies**
39+
#### PR #57: Updated Gem Dependencies
40+
3441
- Updated to latest stable versions with version pinning
3542
- Gems: docker-api ~> 2.4, rake ~> 13.0, rspec ~> 3.13, serverspec ~> 2.43
3643
- Includes security patches and bug fixes
3744

38-
**PR #63: Logger Gem for Ruby 4.0**
45+
#### PR #63: Logger Gem for Ruby 4.0
46+
3947
- Added explicit `logger` gem dependency
4048
- Fixes Ruby 4.0 deprecation warning
4149
- Ensures forward compatibility
4250

4351
### 🧪 Testing Improvements
4452

45-
**PR #64: Ruby Version Matrix**
53+
#### PR #64: Ruby Version Matrix
54+
4655
- Implemented GitHub Actions matrix testing
4756
- Tests on Ruby 3.4 (maintenance) and Ruby 4.0 (latest)
4857
- Ensures compatibility across Ruby versions
4958
- fail-fast: false allows all versions to complete
5059

51-
**PR #65: Node.js LTS Updates**
60+
#### PR #65: Node.js LTS Updates
61+
5262
- Updated from Node.js 20 & 22 to 22 & 24
5363
- Node.js 22.22.0 (Maintenance LTS)
5464
- Node.js 24.13.0 (Active LTS "Krypton")
5565
- Includes latest security patches (January 2026)
5666

5767
### 🛡️ Reliability & Error Handling
5868

59-
**PR #61: Comprehensive Error Handling**
69+
#### PR #61: Comprehensive Error Handling
70+
6071
- Added try/catch blocks in `create_image` and `delete_image`
6172
- Guards against nil @image references
6273
- Clear error messages for debugging
6374
- Informative status messages
6475

65-
**PR #60: Removed Redundant Tagging**
76+
#### PR #60: Removed Redundant Tagging
77+
6678
- Removed unused `@image.tag()` call
6779
- Simplified image lifecycle management
6880

6981
### 🔧 Developer Experience
7082

71-
**PR #59: Bundler Config & .gitignore**
83+
#### PR #59: Bundler Config & .gitignore
84+
7285
- Added `.bundle/config` for local gem installation
7386
- Created `.gitignore` to exclude vendor/bundle, .DS_Store, etc.
7487
- Enables `bundle install` without sudo
7588
- Cleaner repository
7689

7790
### 📚 Documentation
7891

79-
**PR #66: Updated README**
92+
#### PR #66: Updated README
93+
8094
- Updated directory references from (20 and 22) to (22 and 24)
8195
- Keeps documentation in sync with code changes
8296

8397
## Metrics
8498

8599
### Before AI Assistance
100+
86101
- Critical container cleanup bug (system-wide impact)
87102
- Sequential test execution (~35 seconds)
88103
- Outdated dependencies
@@ -93,6 +108,7 @@ Between February 2026, this project underwent a comprehensive modernization effo
93108
- Sudo required for gem installation
94109

95110
### After AI Assistance
111+
96112
- Safe, isolated container cleanup
97113
- Parallel test execution (~18 seconds, 47% faster)
98114
- Latest stable dependencies with version pinning
@@ -105,14 +121,17 @@ Between February 2026, this project underwent a comprehensive modernization effo
105121
## Technology Stack Updates
106122

107123
### Ruby Versions Tested
124+
108125
- Ruby 3.4.x (Stable maintenance)
109126
- Ruby 4.0.x (Latest stable)
110127

111128
### Node.js Versions Tested
129+
112130
- Node.js 22.22.0 (Maintenance LTS "Jod")
113131
- Node.js 24.13.0 (Active LTS "Krypton")
114132

115133
### Gem Versions
134+
116135
- docker-api ~> 2.4
117136
- rake ~> 13.0
118137
- rspec ~> 3.13
@@ -122,18 +141,21 @@ Between February 2026, this project underwent a comprehensive modernization effo
122141
## AI Agent Methodology
123142

124143
### Analysis Phase
144+
125145
1. Comprehensive code review of existing implementation
126146
2. Identification of bugs, inefficiencies, and technical debt
127147
3. Prioritization of issues by severity and impact
128148
4. Research of current best practices and latest versions
129149

130150
### Implementation Phase
151+
131152
1. Incremental improvements via focused pull requests
132153
2. Testing at each step before proceeding
133154
3. CI/CD validation for all changes
134155
4. Clear documentation in commit messages and PR descriptions
135156

136157
### Verification Phase
158+
137159
1. Local testing before each commit
138160
2. GitHub Actions CI validation
139161
3. Multi-version compatibility testing
@@ -142,6 +164,7 @@ Between February 2026, this project underwent a comprehensive modernization effo
142164
## Pull Request Links
143165

144166
All improvements are documented in individual pull requests:
167+
145168
- [PR #56](../../pull/56) - Fixed unsafe container cleanup
146169
- [PR #57](../../pull/57) - Updated gem dependencies
147170
- [PR #58](../../pull/58) - Parallel test execution
@@ -157,24 +180,28 @@ All improvements are documented in individual pull requests:
157180
## Best Practices Demonstrated
158181

159182
### Code Quality
183+
160184
- Comprehensive error handling
161185
- Resource cleanup in all code paths
162186
- Clear, informative logging
163187
- No technical debt
164188

165189
### Testing
190+
166191
- Multi-version testing (Ruby 3.4 & 4.0)
167192
- Multi-platform testing (Node.js 22 & 24)
168193
- Parallel execution for efficiency
169194
- CI/CD automation
170195

171196
### Dependencies
197+
172198
- Version pinning for reproducibility
173199
- Regular updates for security
174200
- Explicit dependencies (no implicit defaults)
175201
- Forward compatibility considerations
176202

177203
### Documentation
204+
178205
- Clear commit messages
179206
- Detailed PR descriptions
180207
- Updated README
@@ -191,14 +218,18 @@ All improvements are documented in individual pull requests:
191218
## Future Considerations
192219

193220
While the project is now in excellent shape, potential future improvements could include:
221+
194222
- Additional Node.js LTS version testing (e.g., v26 when released)
195223
- Ruby 4.1 when it enters LTS
196224
- Container image caching between test runs
197225
- Performance benchmarking automation
198226

199227
## Acknowledgments
200228

201-
This project benefited from AI assistance using Factory's Droid agent, which helped identify issues, research solutions, implement fixes, and ensure comprehensive testing. All changes were reviewed and approved by the project maintainer.
229+
This project benefited from AI assistance using Factory's Droid agent, which
230+
helped identify issues, research solutions, implement fixes, and ensure
231+
comprehensive testing. All changes were reviewed and approved by the project
232+
maintainer.
202233

203234
---
204235

0 commit comments

Comments
 (0)