codeguardian-cli 1.1.2__tar.gz → 1.2.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.
- codeguardian_cli-1.2.2/CODEGUARDIAN/src/discovery/finder.py +50 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/PKG-INFO +1 -1
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/codeguardian_cli.egg-info/PKG-INFO +1 -1
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/pyproject.toml +1 -1
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_architecture_validator.py +2 -2
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_ast_cache.py +1 -1
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_file_cache.py +1 -1
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_malformed_source.py +2 -2
- codeguardian_cli-1.1.2/CODEGUARDIAN/src/discovery/finder.py +0 -41
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/__init__.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/analyzers/__init__.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/analyzers/circular_dependency_analyzer.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/analyzers/db_access_analyzer.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/analyzers/dependency_analyzer.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/analyzers/file_analyzer.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/analyzers/function_analyzer.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/analyzers/source_code_analyzer.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/cli/__init__.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/cli/commands.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/config/__init__.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/config/config_loader.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/config/settings.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/main.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/reports/__init__.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/reports/architecture_score.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/reports/console_reporter.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/reports/html_reporter.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/reports/json_reporter.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/reports/markdown_reporter.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/reports/severity.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/reports/statistics_reporter.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/rules/__init__.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/rules/architecture_rules.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/rules/architecture_validator.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/rules/controllers/user_controller.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/__init__.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/discovery/__init__.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/extractor/__init__.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/extractor/class_extractor.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/extractor/function_extractor.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/extractor/import_extractor.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/extractor/python_class_extractor.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/extractor/python_function_extractor.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/extractor/python_imports_extractor.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/main.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/parser/__init__.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/parser/ts_parser.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/tree/Walker.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/tree/__init__.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/utils/__init__.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/utils/ast_cache.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/utils/file_cache.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/utils/layer_utils.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/README.md +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/codeguardian_cli.egg-info/SOURCES.txt +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/codeguardian_cli.egg-info/dependency_links.txt +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/codeguardian_cli.egg-info/entry_points.txt +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/codeguardian_cli.egg-info/requires.txt +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/codeguardian_cli.egg-info/top_level.txt +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/setup.cfg +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_circular_dependency.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_class_extractor.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_config_loader.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_dependencies.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_dependency_analyzer.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_discovery.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_function_analyzer.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_function_extractor.py +0 -0
- {codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/tests/test_ts_parser.py +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
IGNORE_DIRS = {
|
|
5
|
+
"venv",
|
|
6
|
+
".venv",
|
|
7
|
+
".git",
|
|
8
|
+
"__pycache__",
|
|
9
|
+
".pytest_cache",
|
|
10
|
+
"node_modules",
|
|
11
|
+
"dist",
|
|
12
|
+
"build",
|
|
13
|
+
"tests",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def discover_files(project_path, extensions):
|
|
18
|
+
|
|
19
|
+
project_path = Path(project_path)
|
|
20
|
+
|
|
21
|
+
files = []
|
|
22
|
+
|
|
23
|
+
for root, dirs, filenames in os.walk(project_path):
|
|
24
|
+
|
|
25
|
+
# Ignore predefined directories
|
|
26
|
+
dirs[:] = [
|
|
27
|
+
d for d in dirs
|
|
28
|
+
if d not in IGNORE_DIRS
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
# Ignore Python virtual environments
|
|
32
|
+
dirs[:] = [
|
|
33
|
+
d for d in dirs
|
|
34
|
+
if not (Path(root) / d / "pyvenv.cfg").exists()
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
for filename in filenames:
|
|
38
|
+
|
|
39
|
+
file_path = Path(root) / filename
|
|
40
|
+
|
|
41
|
+
if filename.startswith("test_"):
|
|
42
|
+
continue
|
|
43
|
+
|
|
44
|
+
if (
|
|
45
|
+
file_path.is_file()
|
|
46
|
+
and file_path.suffix in extensions
|
|
47
|
+
):
|
|
48
|
+
files.append(file_path)
|
|
49
|
+
|
|
50
|
+
return files
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
from analyzers.dependency_analyzer import DependencyAnalyzer
|
|
2
|
-
from rules.architecture_validator import ArchitectureValidator
|
|
1
|
+
from CODEGUARDIAN.analyzers.dependency_analyzer import DependencyAnalyzer
|
|
2
|
+
from CODEGUARDIAN.rules.architecture_validator import ArchitectureValidator
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
def test_architecture_validator():
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from analyzers.function_analyzer import FunctionAnalyzer
|
|
1
|
+
from CODEGUARDIAN.analyzers.function_analyzer import FunctionAnalyzer
|
|
2
2
|
|
|
3
|
-
from analyzers.source_code_analyzer import SourceCodeAnalyzer
|
|
3
|
+
from CODEGUARDIAN.analyzers.source_code_analyzer import SourceCodeAnalyzer
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def test_malformed_typescript_is_skipped():
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
|
|
3
|
-
IGNORE_DIRS = {
|
|
4
|
-
"venv",
|
|
5
|
-
".venv",
|
|
6
|
-
"env",
|
|
7
|
-
".env",
|
|
8
|
-
"cg_env",
|
|
9
|
-
".git",
|
|
10
|
-
"__pycache__",
|
|
11
|
-
".pytest_cache",
|
|
12
|
-
"node_modules",
|
|
13
|
-
"dist",
|
|
14
|
-
"build",
|
|
15
|
-
"tests",
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def discover_files(project_path, extensions) -> list[Path]:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
project_path = Path(project_path)
|
|
24
|
-
|
|
25
|
-
files = []
|
|
26
|
-
|
|
27
|
-
for file in project_path.rglob("*"):
|
|
28
|
-
|
|
29
|
-
if any(part in IGNORE_DIRS for part in file.parts):
|
|
30
|
-
continue
|
|
31
|
-
|
|
32
|
-
if file.name.startswith("test_"):
|
|
33
|
-
continue
|
|
34
|
-
|
|
35
|
-
if file.is_file() and file.suffix in extensions:
|
|
36
|
-
files.append(file)
|
|
37
|
-
|
|
38
|
-
return files
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/analyzers/db_access_analyzer.py
RENAMED
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/analyzers/dependency_analyzer.py
RENAMED
|
File without changes
|
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/analyzers/function_analyzer.py
RENAMED
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/analyzers/source_code_analyzer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/reports/architecture_score.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/reports/statistics_reporter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/rules/architecture_validator.py
RENAMED
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/rules/controllers/user_controller.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/extractor/class_extractor.py
RENAMED
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/extractor/function_extractor.py
RENAMED
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/CODEGUARDIAN/src/extractor/import_extractor.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/codeguardian_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{codeguardian_cli-1.1.2 → codeguardian_cli-1.2.2}/codeguardian_cli.egg-info/entry_points.txt
RENAMED
|
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
|
|
File without changes
|