slopthreshold 2.1.0.dev22__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- slopthreshold-2.1.0.dev22/.gitignore +3 -0
- slopthreshold-2.1.0.dev22/PKG-INFO +49 -0
- slopthreshold-2.1.0.dev22/README.md +31 -0
- slopthreshold-2.1.0.dev22/build_package.py +44 -0
- slopthreshold-2.1.0.dev22/pyproject.toml +34 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/__init__.py +1 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/guide/STYLE_GUIDE.md +495 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/editorconfig-pack/.editorconfig +899 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/editorconfig-pack/Directory.Build.props +47 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/editorconfig-pack/Directory.Build.targets +16 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/editorconfig-pack/Directory.Packages.props +29 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/editorconfig-pack/README.md +141 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/editorconfig-pack/global.json +7 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/editorconfig-pack/nuget.config +19 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/editorconfig-pack/ruff.toml +29 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/editorconfig-pack/sonar-drift-allowlist.json +10 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/frontend-lint-pack/.prettierrc.json +7 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/frontend-lint-pack/.stylelintrc.json +64 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/frontend-lint-pack/README.md +64 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/frontend-lint-pack/eslint.config.mjs +108 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/frontend-lint-pack/package.json +23 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/frontend-lint-pack/tsconfig.app.json +17 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/frontend-lint-pack/tsconfig.base.json +20 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/frontend-lint-pack/tsconfig.json +4 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/frontend-lint-pack/tsconfig.spec.json +8 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/project-guide-starters/app-STYLE_GUIDE.md +35 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/project-guide-starters/frontend-STYLE_GUIDE.md +33 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/project-guide-starters/library-STYLE_GUIDE.md +36 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/three-layer-wiring/.githooks/commit-msg +13 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/three-layer-wiring/.githooks/post-merge +8 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/three-layer-wiring/.githooks/pre-commit +10 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/three-layer-wiring/.githooks/pre-push +14 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/three-layer-wiring/.github/actionlint.yaml +3 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/three-layer-wiring/.github/workflows/quality.yml +164 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/three-layer-wiring/.gitleaks.toml +16 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/three-layer-wiring/.hadolint.yaml +6 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/three-layer-wiring/README.md +62 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/packs/three-layer-wiring/budget.json +14 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/tools/check_characters.py +104 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/tools/check_ci_config.py +405 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/tools/check_package_health.py +554 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/tools/check_sonar_drift.py +1123 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/tools/mine_sonar_metrics.py +1259 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/tools/validate_guide_tags.py +795 -0
- slopthreshold-2.1.0.dev22/src/slopthreshold/zh.py +973 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: slopthreshold
|
|
3
|
+
Version: 2.1.0.dev22
|
|
4
|
+
Summary: SlopThreshold - the threshold slop doesn't cross. zh CLI: style-guide tag validation, package health gate, Sonar drift and metrics for the ZhEaIsNsAaBn house rules.
|
|
5
|
+
Project-URL: Homepage, https://hassanragai.dev/Documentations/SlopThreshold/
|
|
6
|
+
Project-URL: Repository, https://github.com/ZHEAISNSAABN/ZhEaIsNsAaBn.SlopThreshold
|
|
7
|
+
Author: Hassan Mohamed Ragai
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: ai-code-review,code-quality,dotnet,lint,sonarqube,style-guide
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# SlopThreshold
|
|
20
|
+
|
|
21
|
+
**The threshold slop doesn't cross.**
|
|
22
|
+
|
|
23
|
+
SlopThreshold is a code-quality enforcement system: a 258-rule style guide
|
|
24
|
+
for .NET and frontend stacks, build-time enforcement packs, git hooks and CI
|
|
25
|
+
gates, and an AI review skill. This package ships the `zh` command line —
|
|
26
|
+
the deterministic layer that runs the same checks locally, in hooks and in
|
|
27
|
+
CI.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install slopthreshold
|
|
31
|
+
zh adopt app # install the packs, starter guide, tools and hooks
|
|
32
|
+
zh doctor # check your wiring
|
|
33
|
+
zh check # tags + health + format + lint + secrets
|
|
34
|
+
zh pr # local mirror of CI
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Highlights:
|
|
38
|
+
|
|
39
|
+
- **Style-guide tags**: validates `OVERRIDE` / `BYPASS` tags against the
|
|
40
|
+
generalized guide (tiers, approvers, expiry, scopes).
|
|
41
|
+
- **Package health gate**: grades NuGet/npm pins for licence, maintenance
|
|
42
|
+
freshness and known vulnerabilities (OSV), with recorded evidence.
|
|
43
|
+
- **Size thresholds**: method 50 lines, class 500, cognitive complexity 15 —
|
|
44
|
+
enforced by the bundled packs so AI-written code cannot sprawl.
|
|
45
|
+
- **Sonar drift + metrics**: compares your SonarQube profile with the local
|
|
46
|
+
pack and mines repeat findings into pack improvements.
|
|
47
|
+
|
|
48
|
+
Full documentation: https://hassanragai.dev/Documentations/SlopThreshold/
|
|
49
|
+
Source: https://github.com/ZHEAISNSAABN/ZhEaIsNsAaBn.SlopThreshold
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# SlopThreshold
|
|
2
|
+
|
|
3
|
+
**The threshold slop doesn't cross.**
|
|
4
|
+
|
|
5
|
+
SlopThreshold is a code-quality enforcement system: a 258-rule style guide
|
|
6
|
+
for .NET and frontend stacks, build-time enforcement packs, git hooks and CI
|
|
7
|
+
gates, and an AI review skill. This package ships the `zh` command line —
|
|
8
|
+
the deterministic layer that runs the same checks locally, in hooks and in
|
|
9
|
+
CI.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install slopthreshold
|
|
13
|
+
zh adopt app # install the packs, starter guide, tools and hooks
|
|
14
|
+
zh doctor # check your wiring
|
|
15
|
+
zh check # tags + health + format + lint + secrets
|
|
16
|
+
zh pr # local mirror of CI
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Highlights:
|
|
20
|
+
|
|
21
|
+
- **Style-guide tags**: validates `OVERRIDE` / `BYPASS` tags against the
|
|
22
|
+
generalized guide (tiers, approvers, expiry, scopes).
|
|
23
|
+
- **Package health gate**: grades NuGet/npm pins for licence, maintenance
|
|
24
|
+
freshness and known vulnerabilities (OSV), with recorded evidence.
|
|
25
|
+
- **Size thresholds**: method 50 lines, class 500, cognitive complexity 15 —
|
|
26
|
+
enforced by the bundled packs so AI-written code cannot sprawl.
|
|
27
|
+
- **Sonar drift + metrics**: compares your SonarQube profile with the local
|
|
28
|
+
pack and mines repeat findings into pack improvements.
|
|
29
|
+
|
|
30
|
+
Full documentation: https://hassanragai.dev/Documentations/SlopThreshold/
|
|
31
|
+
Source: https://github.com/ZHEAISNSAABN/ZhEaIsNsAaBn.SlopThreshold
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Assemble the PyPI package tree from the repo (single source of truth).
|
|
3
|
+
|
|
4
|
+
Copies tools/, packs/ and the guide into pypi/src/slopthreshold/, then the
|
|
5
|
+
caller runs `python -m build` in pypi/. Version comes from the repo VERSION
|
|
6
|
+
file so the package and the docs release move together.
|
|
7
|
+
"""
|
|
8
|
+
import os
|
|
9
|
+
import pathlib
|
|
10
|
+
import shutil
|
|
11
|
+
import sys
|
|
12
|
+
|
|
13
|
+
ROOT = pathlib.Path(__file__).resolve().parent.parent
|
|
14
|
+
PKG = ROOT / "pypi" / "src" / "slopthreshold"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def copy_tree(src: pathlib.Path, dst: pathlib.Path) -> None:
|
|
18
|
+
if dst.exists():
|
|
19
|
+
shutil.rmtree(dst)
|
|
20
|
+
shutil.copytree(src, dst, ignore=shutil.ignore_patterns(
|
|
21
|
+
"__pycache__", "node_modules", "*.pyc", "test_*.py", "tests"))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def main() -> int:
|
|
25
|
+
version = os.environ.get("SLOPTHRESHOLD_VERSION") or (ROOT / "VERSION").read_text().strip()
|
|
26
|
+
if PKG.exists():
|
|
27
|
+
shutil.rmtree(PKG)
|
|
28
|
+
(PKG / "tools").mkdir(parents=True)
|
|
29
|
+
(PKG / "__init__.py").write_text(f'__version__ = "{version}"\n')
|
|
30
|
+
shutil.copy2(ROOT / "tools" / "zh.py", PKG / "zh.py")
|
|
31
|
+
for tool in ["validate_guide_tags.py", "check_package_health.py",
|
|
32
|
+
"check_sonar_drift.py", "mine_sonar_metrics.py", "check_characters.py", "check_ci_config.py"]:
|
|
33
|
+
shutil.copy2(ROOT / "tools" / tool, PKG / "tools" / tool)
|
|
34
|
+
(PKG / "guide").mkdir()
|
|
35
|
+
shutil.copy2(ROOT / "docs" / "style-guide.md", PKG / "guide" / "STYLE_GUIDE.md")
|
|
36
|
+
for pack in ["editorconfig-pack", "frontend-lint-pack",
|
|
37
|
+
"three-layer-wiring", "project-guide-starters"]:
|
|
38
|
+
copy_tree(ROOT / "packs" / pack, PKG / "packs" / pack)
|
|
39
|
+
print(f"assembled slopthreshold {version} -> {PKG}")
|
|
40
|
+
return 0
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
if __name__ == "__main__":
|
|
44
|
+
sys.exit(main())
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "slopthreshold"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "SlopThreshold - the threshold slop doesn't cross. zh CLI: style-guide tag validation, package health gate, Sonar drift and metrics for the ZhEaIsNsAaBn house rules."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Hassan Mohamed Ragai" }]
|
|
13
|
+
keywords = ["code-quality", "style-guide", "lint", "sonarqube", "dotnet", "ai-code-review"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.scripts]
|
|
24
|
+
zh = "slopthreshold.zh:main"
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://hassanragai.dev/Documentations/SlopThreshold/"
|
|
28
|
+
Repository = "https://github.com/ZHEAISNSAABN/ZhEaIsNsAaBn.SlopThreshold"
|
|
29
|
+
|
|
30
|
+
[tool.hatch.version]
|
|
31
|
+
path = "src/slopthreshold/__init__.py"
|
|
32
|
+
|
|
33
|
+
[tool.hatch.build.targets.wheel]
|
|
34
|
+
packages = ["src/slopthreshold"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.1.0.dev22"
|