Skip to content

Commit cdf8a1f

Browse files
author
DevForge Engineer
committed
feat: CODEOWNERS, auto-code-review workflow, AGENTS.md, eslint config; cli/diff/loader + test updates
1 parent 85930a5 commit cdf8a1f

19 files changed

Lines changed: 517 additions & 155 deletions

‎.github/CODEOWNERS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @Coding-Dev-Tools
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Automated Code Review — caller workflow
2+
#
3+
# Drop this file into any Coding-Dev-Tools repo at
4+
# .github/workflows/auto-code-review.yml to enable
5+
# automated PR code review (lint, format, secret detection,
6+
# TODO/FIXME check, large file check, and PR comment summary).
7+
#
8+
# The reusable workflow is defined in the org .github repo:
9+
# Coding-Dev-Tools/.github/.github/workflows/auto-code-review.yml@main
10+
11+
name: Auto Code Review
12+
13+
on:
14+
pull_request:
15+
branches: [main, master]
16+
types: [opened, synchronize, reopened]
17+
push:
18+
branches: [main, master]
19+
workflow_dispatch:
20+
21+
permissions:
22+
contents: read
23+
pull-requests: write
24+
security-events: write
25+
26+
jobs:
27+
code-review:
28+
uses: Coding-Dev-Tools/.github/.github/workflows/auto-code-review.yml@main

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ jobs:
1717
python-version: ["3.10", "3.11", "3.12", "3.13"]
1818

1919
steps:
20-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
20+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2121
with:
2222
persist-credentials: false
2323

2424
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
25+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
2626
with:
2727
python-version: ${{ matrix.python-version }}
28+
cache: "pip"
2829

2930
- name: Install dependencies
3031
run: |
32+
pip config set global.retries 5 || true
3133
pip install -e ".[dev]"
3234
3335
- name: Lint with ruff
3436
run: ruff check src/ tests/
3537
- name: Run tests
36-
run: |
37-
python -m pytest tests/ -v --cov=src --cov-report=term-missing

‎.gitignore‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ __pycache__/
55

66
# C extensions
77
*.so
8-
98
# Distribution / packaging
109
.Python
1110
build/
@@ -22,15 +21,12 @@ var/
2221
wheels/
2322
*.egg-info/
2423
*.egg
25-
2624
# PyInstaller
2725
*.manifest
2826
*.spec
29-
3027
# Installer logs
3128
pip-log.txt
3229
pip-delete-this-directory.txt
33-
3430
# Unit test / coverage
3531
htmlcov/
3632
.tox/
@@ -44,31 +40,27 @@ coverage.xml
4440
*.py,cover
4541
.hypothesis/
4642
.pytest_cache/
47-
4843
# Translations
4944
*.mo
5045
*.pot
51-
5246
# Environments
5347
.env
5448
.venv
5549
env/
5650
venv/
5751
ENV/
58-
5952
# IDE
6053
.vscode/
6154
.idea/
6255
*.swp
6356
*.swo
6457
*~
65-
6658
# OS
6759
.DS_Store
6860
Thumbs.db
69-
7061
# Project specific
7162
research/
7263
fixtures/generated/
7364
.ruff_cache/
74-
build/
65+
node_modules/
66+
nul

‎AGENTS.md‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# configdrift
2+
3+
## Purpose
4+
CLI tool that detects and fixes configuration file drift across environments (dev/staging/prod). Supports YAML, JSON, TOML, and .env formats.
5+
6+
## Build & Test Commands
7+
- Install: `pip install -e .` or `pip install git+https://github.com/Coding-Dev-Tools/configdrift.git`
8+
- Test: `pytest tests/` (or `python -m pytest tests/ -v --tb=short`)
9+
- Lint: `ruff check src/ tests/`
10+
- Build: `pip install build twine && python -m build && twine check dist/*`
11+
- CLI check: `configdrift --help`
12+
13+
## Architecture
14+
Key directories:
15+
- `src/configdrift/` — Main package (CLI, config parsers, drift detection, compliance)
16+
- `tests/` — Test suite
17+
- `.github/workflows/` — CI/CD (auto-code-review.yml, ci.yml, pages.yml, publish.yml)
18+
- `dist/` — Built distributions
19+
20+
## Conventions
21+
- Language: Python 3.10+
22+
- Test framework: pytest (with coverage)
23+
- CI: GitHub Actions (matrix: Python 3.10, 3.11, 3.12, 3.13)
24+
- Linting: ruff (line-length 120, target py310)
25+
- Formatting: ruff
26+
- Package layout: src/ layout with setuptools
27+
- Type checking: py.typed included
28+
- Dependencies: typer, rich, pyyaml, tomli, tomli-w
29+
- CLI entry point: configdrift.cli:app
30+
- Default branch: main

‎README.md‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Keep configurations consistent across all environments, automatically. ConfigDri
1010
![Python](https://img.shields.io/badge/python-3.10%2B-blue)
1111
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Coding-Dev-Tools/configdrift/blob/main/LICENSE)
1212
[![Open Source Alternative](https://img.shields.io/badge/Open_Source_Alternative-%E2%87%92-blue?logo=opensourceinitiative)](https://www.opensourcealternative.to/project/configdrift)
13-
[![CI](https://github.com/Coding-Dev-Tools/configdrift/actions/workflows/ci.yml/badge.svg)](https://github.com/Coding-Dev-Tools/configdrift/actions/workflows/ci.yml)
14-
[![GitHub last commit](https://img.shields.io/github/last-commit/Coding-Dev-Tools/configdrift)](https://github.com/Coding-Dev-Tools/configdrift/commits)
13+
|[![LibHunt](https://img.shields.io/badge/LibHunt-%E2%87%92-blue?logo=codeigniter)](https://www.libhunt.com/r/Coding-Dev-Tools/configdrift)
14+
|[![PyPI](https://img.shields.io/pypi/v/configdrift)](https://pypi.org/project/configdrift/)
1515

1616

1717

@@ -92,6 +92,22 @@ Use `--output silent` for CI gating:
9292
configdrift check dev.yaml prod.yaml --output silent || echo "Drift detected!"
9393
```
9494

95+
### GitHub Actions example
96+
97+
```yaml
98+
- name: Detect config drift
99+
run: |
100+
pip install configdrift
101+
configdrift check ./config/staging/app.yaml ./config/prod/app.yaml --output silent
102+
```
103+
104+
## Troubleshooting
105+
106+
- **Exit code 1 with no output**: use `--output table` to inspect drift details.
107+
- **TOML parsing errors on Python < 3.11**: install `tomli` and `tomli-w` or use Python 3.11+.
108+
- **Large config scans are slow**: narrow the scan to changed files or a single directory.
109+
- **Unexpected breaking drift**: review severity rules in the project settings; `database*` and `auth*` keys are flagged as breaking by default.
110+
95111
## Supported Formats
96112

97113
| Format | Extension | Notes |
@@ -149,6 +165,18 @@ ConfigDrift is one of 11 tools in the Revenue Holdings suite. One license covers
149165
| SSO / SAML / OIDC | — | — | — | — | ✓ |
150166
| Priority support | Community | 24h | 24h | 8h | Dedicated |
151167

168+
---
169+
170+
<p align="center">
171+
<sub>Part of <a href="https://coding-dev-tools.github.io/devforge/">Revenue Holdings</a> — CLI tools built by autonomous AI.</sub>
172+
</p>
173+
152174
## License
153175

154176
MIT
177+
178+
## Test
179+
180+
```bash
181+
npm test # runs: node --test tests/
182+
```

‎eslint.config.mjs‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
4+
export default [
5+
js.configs.recommended,
6+
{
7+
languageOptions: {
8+
ecmaVersion: 2023,
9+
sourceType: "module",
10+
globals: { ...globals.node },
11+
},
12+
rules: {
13+
"no-unused-vars": "error",
14+
"no-undef": "error",
15+
"no-console": "warn",
16+
"eqeqeq": "error",
17+
"no-eval": "error",
18+
"no-implied-eval": "error",
19+
},
20+
},
21+
];

‎package.json‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,19 @@
3737
],
3838
"engines": {
3939
"node": ">=16.0.0"
40+
},
41+
"preferGlobal": true,
42+
"devDependencies": {
43+
"@eslint/js": "^9.0.0",
44+
"eslint": "^9.0.0",
45+
"globals": "^15.0.0"
46+
},
47+
"publishConfig": {
48+
"access": "public"
49+
},
50+
"scripts": {
51+
"test": "node --test tests/*.test.js",
52+
"lint": "eslint .",
53+
"test:py": "pytest"
4054
}
41-
}
55+
}

‎pyproject.toml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description = "CLI tool that detects and fixes configuration file drift across e
99
readme = "README.md"
1010
requires-python = ">=3.10"
1111
license = "MIT"
12-
authors = [{name = "Coding-Dev-Tools"}]
12+
authors = [{name = "DevForge"}]
1313
keywords = ["config", "drift", "diff", "env", "devops", "cli"]
1414
classifiers = [
1515
"Development Status :: 4 - Beta",
@@ -36,6 +36,7 @@ dev = [
3636
"ruff>=0.4.0",
3737
]
3838
toml = ["tomli>=2.0.0", "tomli-w>=1.0.0"]
39+
license-check = ["revenueholdings-license>=0.1.0"]
3940

4041
[project.urls]
4142
Homepage = "https://github.com/Coding-Dev-Tools/configdrift"
@@ -50,6 +51,9 @@ configdrift = "configdrift.cli:app"
5051
[tool.setuptools.packages.find]
5152
where = ["src"]
5253

54+
55+
[tool.setuptools.package-data]
56+
"*" = ["py.typed"]
5357
[tool.pytest.ini_options]
5458
testpaths = ["tests"]
5559
addopts = "-v --tb=short"

0 commit comments

Comments
 (0)