codefence 1.0.0__tar.gz → 1.0.2__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.
Files changed (28) hide show
  1. {codefence-1.0.0 → codefence-1.0.2}/PKG-INFO +1 -2
  2. {codefence-1.0.0 → codefence-1.0.2}/codefence.egg-info/PKG-INFO +1 -2
  3. {codefence-1.0.0 → codefence-1.0.2}/codefence.py +23 -2
  4. {codefence-1.0.0 → codefence-1.0.2}/pyproject.toml +3 -7
  5. {codefence-1.0.0 → codefence-1.0.2}/CHANGELOG.md +0 -0
  6. {codefence-1.0.0 → codefence-1.0.2}/LICENSE.txt +0 -0
  7. {codefence-1.0.0 → codefence-1.0.2}/LICENSE_FAQ.md +0 -0
  8. {codefence-1.0.0 → codefence-1.0.2}/NOTICE.md +0 -0
  9. {codefence-1.0.0 → codefence-1.0.2}/README.md +0 -0
  10. {codefence-1.0.0 → codefence-1.0.2}/REFUND_POLICY.md +0 -0
  11. {codefence-1.0.0 → codefence-1.0.2}/SECURITY.md +0 -0
  12. {codefence-1.0.0 → codefence-1.0.2}/TERMS_OF_USE.md +0 -0
  13. {codefence-1.0.0 → codefence-1.0.2}/codefence.egg-info/SOURCES.txt +0 -0
  14. {codefence-1.0.0 → codefence-1.0.2}/codefence.egg-info/dependency_links.txt +0 -0
  15. {codefence-1.0.0 → codefence-1.0.2}/codefence.egg-info/entry_points.txt +0 -0
  16. {codefence-1.0.0 → codefence-1.0.2}/codefence.egg-info/top_level.txt +0 -0
  17. {codefence-1.0.0 → codefence-1.0.2}/rules.json +0 -0
  18. {codefence-1.0.0 → codefence-1.0.2}/samples/bad_javascript.js +0 -0
  19. {codefence-1.0.0 → codefence-1.0.2}/samples/bad_python.py +0 -0
  20. {codefence-1.0.0 → codefence-1.0.2}/samples/clean_example.js +0 -0
  21. {codefence-1.0.0 → codefence-1.0.2}/samples/clean_example.py +0 -0
  22. {codefence-1.0.0 → codefence-1.0.2}/setup.cfg +0 -0
  23. {codefence-1.0.0 → codefence-1.0.2}/tests/test_baseline.py +0 -0
  24. {codefence-1.0.0 → codefence-1.0.2}/tests/test_history.py +0 -0
  25. {codefence-1.0.0 → codefence-1.0.2}/tests/test_integration.py +0 -0
  26. {codefence-1.0.0 → codefence-1.0.2}/tests/test_lexer.py +0 -0
  27. {codefence-1.0.0 → codefence-1.0.2}/tests/test_policy.py +0 -0
  28. {codefence-1.0.0 → codefence-1.0.2}/tests/test_rules.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codefence
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: A tiny offline policy gate for code. Check AI-generated code before it reaches Git.
5
5
  Author: CodeFence
6
6
  License: CODEFENCE
@@ -206,7 +206,6 @@ Keywords: security,static-analysis,pre-commit,git-hook,ai-generated-code,sast,sa
206
206
  Classifier: Development Status :: 5 - Production/Stable
207
207
  Classifier: Environment :: Console
208
208
  Classifier: Intended Audience :: Developers
209
- Classifier: License :: Other/Proprietary License
210
209
  Classifier: Operating System :: OS Independent
211
210
  Classifier: Programming Language :: Python :: 3
212
211
  Classifier: Programming Language :: Python :: 3.10
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codefence
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: A tiny offline policy gate for code. Check AI-generated code before it reaches Git.
5
5
  Author: CodeFence
6
6
  License: CODEFENCE
@@ -206,7 +206,6 @@ Keywords: security,static-analysis,pre-commit,git-hook,ai-generated-code,sast,sa
206
206
  Classifier: Development Status :: 5 - Production/Stable
207
207
  Classifier: Environment :: Console
208
208
  Classifier: Intended Audience :: Developers
209
- Classifier: License :: Other/Proprietary License
210
209
  Classifier: Operating System :: OS Independent
211
210
  Classifier: Programming Language :: Python :: 3
212
211
  Classifier: Programming Language :: Python :: 3.10
@@ -40,7 +40,7 @@ from typing import Callable, Iterable, Iterator, Sequence
40
40
  # =============================================================================
41
41
 
42
42
  TOOL_NAME = "codefence"
43
- TOOL_VERSION = "1.0.0"
43
+ TOOL_VERSION = "1.0.2"
44
44
  RULES_SCHEMA = "codefence/rules-v1"
45
45
  DEFAULT_MAX_SIZE = 2 * 1024 * 1024
46
46
  DEFAULT_RULES_FILENAME = "rules.json"
@@ -3966,7 +3966,28 @@ def _build_argparser() -> argparse.ArgumentParser:
3966
3966
 
3967
3967
 
3968
3968
  def _default_rules_path() -> Path:
3969
- return Path(__file__).resolve().parent / DEFAULT_RULES_FILENAME
3969
+ """Search common locations for rules.json.
3970
+
3971
+ Covers: source checkout, pip install with --user or --system,
3972
+ data-files installation under sys.prefix or sys.prefix/share,
3973
+ current working directory, and per-user config.
3974
+ """
3975
+ here = Path(__file__).resolve().parent
3976
+ candidates = [
3977
+ here / DEFAULT_RULES_FILENAME,
3978
+ here.parent.parent.parent / DEFAULT_RULES_FILENAME,
3979
+ Path(sys.prefix) / DEFAULT_RULES_FILENAME,
3980
+ Path(sys.prefix) / "share" / "codefence" / DEFAULT_RULES_FILENAME,
3981
+ Path(sys.prefix) / "local" / DEFAULT_RULES_FILENAME,
3982
+ Path(sys.prefix) / "local" / "share" / "codefence" / DEFAULT_RULES_FILENAME,
3983
+ Path.cwd() / DEFAULT_RULES_FILENAME,
3984
+ Path.home() / ".codefence" / DEFAULT_RULES_FILENAME,
3985
+ Path.home() / ".config" / "codefence" / DEFAULT_RULES_FILENAME,
3986
+ ]
3987
+ for c in candidates:
3988
+ if c.is_file():
3989
+ return c
3990
+ return candidates[0]
3970
3991
 
3971
3992
 
3972
3993
  def _collect_paths(paths: Sequence[str],
@@ -1,12 +1,12 @@
1
1
  [build-system]
2
- requires = ["setuptools>=68", "wheel"]
2
+ requires = ["setuptools>=68,<78", "wheel"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "codefence"
7
- version = "1.0.0"
7
+ version = "1.0.2"
8
8
  description = "A tiny offline policy gate for code. Check AI-generated code before it reaches Git."
9
- readme = "README.md"
9
+ readme = {file = "README.md", content-type = "text/markdown"}
10
10
  requires-python = ">=3.10"
11
11
  license = {file = "LICENSE.txt"}
12
12
  authors = [
@@ -20,7 +20,6 @@ classifiers = [
20
20
  "Development Status :: 5 - Production/Stable",
21
21
  "Environment :: Console",
22
22
  "Intended Audience :: Developers",
23
- "License :: Other/Proprietary License",
24
23
  "Operating System :: OS Independent",
25
24
  "Programming Language :: Python :: 3",
26
25
  "Programming Language :: Python :: 3.10",
@@ -45,9 +44,6 @@ codefence = "codefence:main"
45
44
  [tool.setuptools]
46
45
  py-modules = ["codefence"]
47
46
 
48
- [tool.setuptools.package-data]
49
- codefence = ["rules.json"]
50
-
51
47
  [tool.setuptools.data-files]
52
48
  "." = [
53
49
  "rules.json",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes