checkmate5 4.0.92__py3-none-any.whl → 4.0.94__py3-none-any.whl

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 (110) hide show
  1. checkmate/contrib/plugins/__init__.py +0 -0
  2. checkmate/contrib/plugins/cve/__init__.py +0 -0
  3. checkmate/contrib/plugins/cve/text4shell/__init__.py +0 -0
  4. checkmate/contrib/plugins/cve/text4shell/analyzer.py +0 -0
  5. checkmate/contrib/plugins/cve/text4shell/issues_data.py +0 -0
  6. checkmate/contrib/plugins/cve/text4shell/setup.py +0 -0
  7. checkmate/contrib/plugins/git/__init__.py +0 -0
  8. checkmate/contrib/plugins/git/commands/__init__.py +0 -0
  9. checkmate/contrib/plugins/git/commands/analyze.py +0 -0
  10. checkmate/contrib/plugins/git/commands/base.py +0 -0
  11. checkmate/contrib/plugins/git/commands/diff.py +0 -0
  12. checkmate/contrib/plugins/git/commands/init.py +0 -0
  13. checkmate/contrib/plugins/git/commands/update_stats.py +0 -0
  14. checkmate/contrib/plugins/git/hooks/__init__.py +0 -0
  15. checkmate/contrib/plugins/git/hooks/project.py +0 -0
  16. checkmate/contrib/plugins/git/lib/__init__.py +0 -0
  17. checkmate/contrib/plugins/git/lib/repository.py +0 -0
  18. checkmate/contrib/plugins/git/lib/repository_pygit2.py +0 -0
  19. checkmate/contrib/plugins/git/models.py +0 -0
  20. checkmate/contrib/plugins/git/setup.py +0 -0
  21. checkmate/contrib/plugins/golang/__init__.py +0 -0
  22. checkmate/contrib/plugins/golang/gostaticcheck/__init__.py +0 -0
  23. checkmate/contrib/plugins/golang/gostaticcheck/analyzer.py +0 -0
  24. checkmate/contrib/plugins/golang/gostaticcheck/issues_data.py +0 -0
  25. checkmate/contrib/plugins/golang/gostaticcheck/setup.py +0 -0
  26. checkmate/contrib/plugins/iac/__init__.py +0 -0
  27. checkmate/contrib/plugins/iac/kubescape/__init__.py +0 -0
  28. checkmate/contrib/plugins/iac/kubescape/analyzer.py +0 -0
  29. checkmate/contrib/plugins/iac/kubescape/issues_data.py +0 -0
  30. checkmate/contrib/plugins/iac/kubescape/setup.py +0 -0
  31. checkmate/contrib/plugins/iac/tfsec/__init__.py +0 -0
  32. checkmate/contrib/plugins/iac/tfsec/analyzer.py +0 -0
  33. checkmate/contrib/plugins/iac/tfsec/issues_data.py +0 -0
  34. checkmate/contrib/plugins/iac/tfsec/setup.py +0 -0
  35. checkmate/contrib/plugins/java/__init__.py +0 -0
  36. checkmate/contrib/plugins/java/semgrepjava/__init__.py +0 -0
  37. checkmate/contrib/plugins/java/semgrepjava/analyzer.py +0 -0
  38. checkmate/contrib/plugins/java/semgrepjava/issues_data.py +0 -0
  39. checkmate/contrib/plugins/java/semgrepjava/setup.py +0 -0
  40. checkmate/contrib/plugins/javascript/__init__.py +0 -0
  41. checkmate/contrib/plugins/javascript/semgrepeslint/__init__.py +0 -0
  42. checkmate/contrib/plugins/javascript/semgrepeslint/analyzer.py +0 -0
  43. checkmate/contrib/plugins/javascript/semgrepeslint/issues_data.py +0 -0
  44. checkmate/contrib/plugins/javascript/semgrepeslint/setup.py +0 -0
  45. checkmate/contrib/plugins/perl/__init__.py +0 -0
  46. checkmate/contrib/plugins/perl/graudit/__init__.py +0 -0
  47. checkmate/contrib/plugins/perl/graudit/analyzer.py +0 -0
  48. checkmate/contrib/plugins/perl/graudit/issues_data.py +0 -0
  49. checkmate/contrib/plugins/perl/graudit/setup.py +0 -0
  50. checkmate/contrib/plugins/python/__init__.py +0 -0
  51. checkmate/contrib/plugins/python/bandit/__init__.py +0 -0
  52. checkmate/contrib/plugins/python/bandit/analyzer.py +0 -0
  53. checkmate/contrib/plugins/python/bandit/issues_data.py +0 -0
  54. checkmate/contrib/plugins/python/bandit/setup.py +0 -0
  55. checkmate/contrib/plugins/ruby/__init__.py +0 -0
  56. checkmate/contrib/plugins/ruby/brakeman/__init__.py +0 -0
  57. checkmate/contrib/plugins/ruby/brakeman/analyzer.py +0 -0
  58. checkmate/contrib/plugins/ruby/brakeman/issues_data.py +0 -0
  59. checkmate/contrib/plugins/ruby/brakeman/setup.py +0 -0
  60. checkmate/helpers/__init__.py +0 -0
  61. checkmate/helpers/facts.py +0 -0
  62. checkmate/helpers/hashing.py +0 -0
  63. checkmate/helpers/issue.py +0 -0
  64. checkmate/helpers/settings.py +0 -0
  65. checkmate/lib/__init__.py +0 -0
  66. checkmate/lib/analysis/__init__.py +0 -0
  67. checkmate/lib/analysis/base.py +0 -0
  68. checkmate/lib/backend.py +119 -0
  69. checkmate/lib/code/__init__.py +0 -0
  70. checkmate/lib/code/environment.py +0 -0
  71. checkmate/lib/models.py +0 -0
  72. checkmate/lib/stats/__init__.py +0 -0
  73. checkmate/lib/stats/helpers.py +0 -0
  74. checkmate/lib/stats/mapreduce.py +0 -0
  75. checkmate/management/__init__.py +0 -0
  76. checkmate/management/commands/__init__.py +0 -0
  77. checkmate/management/commands/alembic.py +0 -0
  78. checkmate/management/commands/analyze.py +0 -0
  79. checkmate/management/commands/analyzers.py +0 -0
  80. checkmate/management/commands/base.py +0 -0
  81. checkmate/management/commands/compare.py +0 -0
  82. checkmate/management/commands/export.py +0 -0
  83. checkmate/management/commands/info.py +0 -0
  84. checkmate/management/commands/init.py +0 -0
  85. checkmate/management/commands/issues.py +0 -0
  86. checkmate/management/commands/props/__init__.py +0 -0
  87. checkmate/management/commands/props/delete.py +0 -0
  88. checkmate/management/commands/props/get.py +0 -0
  89. checkmate/management/commands/props/set.py +0 -0
  90. checkmate/management/commands/reset.py +0 -0
  91. checkmate/management/commands/shell.py +0 -0
  92. checkmate/management/commands/snapshots.py +0 -0
  93. checkmate/management/commands/stats.py +0 -0
  94. checkmate/management/commands/summary.py +0 -0
  95. checkmate/management/commands/sync.py +0 -0
  96. checkmate/management/commands/trend.py +0 -0
  97. checkmate/management/commands/watch.py +0 -0
  98. checkmate/management/decorators.py +0 -0
  99. checkmate/management/helpers.py +1 -1
  100. checkmate/scripts/__init__.py +0 -0
  101. checkmate/scripts/manage.py +0 -0
  102. checkmate/settings/__init__.py +0 -0
  103. checkmate/settings/base.py +0 -0
  104. checkmate/settings/defaults.py +0 -0
  105. {checkmate5-4.0.92.dist-info → checkmate5-4.0.94.dist-info}/METADATA +1 -1
  106. {checkmate5-4.0.92.dist-info → checkmate5-4.0.94.dist-info}/RECORD +8 -7
  107. {checkmate5-4.0.92.dist-info → checkmate5-4.0.94.dist-info}/LICENSE.txt +0 -0
  108. {checkmate5-4.0.92.dist-info → checkmate5-4.0.94.dist-info}/WHEEL +0 -0
  109. {checkmate5-4.0.92.dist-info → checkmate5-4.0.94.dist-info}/entry_points.txt +0 -0
  110. {checkmate5-4.0.92.dist-info → checkmate5-4.0.94.dist-info}/top_level.txt +0 -0
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
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
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
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
checkmate/lib/__init__.py CHANGED
File without changes
File without changes
File without changes
@@ -0,0 +1,119 @@
1
+ from blitzdb import FileBackend as BlitzDBFileBackend
2
+ from blitzdb.backends.sql import Backend as BlitzDBSQLBackend
3
+ from typing import Any, Optional, Dict
4
+ import logging
5
+ from contextlib import contextmanager
6
+
7
+ logger = logging.getLogger(__name__)
8
+
9
+ class FileBackend(BlitzDBFileBackend):
10
+ def __init__(self, path: str) -> None:
11
+ """Initialize FileBackend with specified path.
12
+
13
+ Args:
14
+ path: Path to store the database files
15
+
16
+ Raises:
17
+ ValueError: If path is invalid
18
+ """
19
+ logger.debug(f"Initializing FileBackend with path: {path}")
20
+ super().__init__(path)
21
+ self.path = path
22
+
23
+ def test_connection(self) -> bool:
24
+ """Test the file access.
25
+
26
+ Returns:
27
+ bool: True if file access is successful
28
+
29
+ Raises:
30
+ ConnectionError: If file access test fails
31
+ """
32
+ try:
33
+ self.begin()
34
+ self.commit()
35
+ logger.info("File access test successful")
36
+ return True
37
+ except Exception as e:
38
+ logger.error(f"File access test failed: {str(e)}")
39
+ raise ConnectionError(f"File access test failed: {str(e)}")
40
+
41
+ @contextmanager
42
+ def session(self):
43
+ """Context manager for file operations.
44
+
45
+ Yields:
46
+ FileBackend: Self with active session
47
+ """
48
+ try:
49
+ self.begin()
50
+ yield self
51
+ self.commit()
52
+ except Exception as e:
53
+ logger.error(f"Session error: {str(e)}")
54
+ self.rollback()
55
+ raise
56
+
57
+ class SQLBackend(BlitzDBSQLBackend):
58
+ def __init__(self, connection: Any) -> None:
59
+ """Initialize SQL Backend with database connection.
60
+
61
+ Args:
62
+ connection: SQLAlchemy engine or connection object
63
+
64
+ Raises:
65
+ ConnectionError: If database connection fails
66
+ """
67
+ logger.debug(f"Initializing SQL Backend with connection: {connection}")
68
+ super().__init__(connection)
69
+ self.connection = connection
70
+
71
+ def test_connection(self) -> bool:
72
+ """Test the database connection.
73
+
74
+ Returns:
75
+ bool: True if connection is successful
76
+
77
+ Raises:
78
+ ConnectionError: If connection test fails
79
+ """
80
+ try:
81
+ with self.connection.connect() as conn:
82
+ conn.execute('SELECT 1')
83
+ logger.info("Database connection test successful")
84
+ return True
85
+ except Exception as e:
86
+ logger.error(f"Database connection test failed: {str(e)}")
87
+ raise ConnectionError(f"Database connection test failed: {str(e)}")
88
+
89
+ @contextmanager
90
+ def session(self):
91
+ """Context manager for database sessions.
92
+
93
+ Yields:
94
+ SQLBackend: Self with active session
95
+ """
96
+ try:
97
+ self.begin()
98
+ yield self
99
+ self.commit()
100
+ except Exception as e:
101
+ logger.error(f"Session error: {str(e)}")
102
+ self.rollback()
103
+ raise
104
+ finally:
105
+ if hasattr(self.connection, 'dispose'):
106
+ self.connection.dispose()
107
+
108
+ def close(self) -> None:
109
+ """Clean up database connections."""
110
+ try:
111
+ if hasattr(self.connection, 'dispose'):
112
+ self.connection.dispose()
113
+ logger.info("Closed SQL Backend connection")
114
+ except Exception as e:
115
+ logger.error(f"Error closing backend: {str(e)}")
116
+ raise
117
+
118
+ # For backward compatibility
119
+ Backend = SQLBackend # Default to SQLBackend for existing code
File without changes
File without changes
checkmate/lib/models.py CHANGED
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
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
@@ -9,7 +9,7 @@ from functools import reduce
9
9
  import argparse
10
10
  from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String
11
11
  from sqlalchemy.exc import SQLAlchemyError
12
- from ...lib.models import Backend
12
+ from checkmate.lib.backend import Backend
13
13
 
14
14
  def get_project_path(path=None):
15
15
  if not path:
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: checkmate5
3
- Version: 4.0.92
3
+ Version: 4.0.94
4
4
  Summary: A meta-code checker written in Python.
5
5
  Author: Andreas Dewes
6
6
  License: AGPL-3.0
@@ -71,6 +71,7 @@ checkmate/helpers/hashing.py,sha256=TcwBFJlciJkLlETQcQBxEWRgwyh2HK9MO4BzN2VMlDU,
71
71
  checkmate/helpers/issue.py,sha256=7wImtI8uZR5VcE_1u7mI8qvEXU97p6Rzkb1bbJkqXKQ,3841
72
72
  checkmate/helpers/settings.py,sha256=97zsz4vNq7EpUpRME4XQvvp5LUp3618ZvSfNTce_4j4,322
73
73
  checkmate/lib/__init__.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
74
+ checkmate/lib/backend.py,sha256=dO3rMqI70D8-9CrgL3qu3fqKf0BXvJCDIgSIys8IRyM,3683
74
75
  checkmate/lib/models.py,sha256=Myzjf7ChJnObPpMLXv34znMXkeP0Fma54iUN9uSl8AI,20191
75
76
  checkmate/lib/analysis/__init__.py,sha256=_JpM1GkChWCfLKqPqEz3-8DCPwNe7lPwQDMoF_6Ore0,45
76
77
  checkmate/lib/analysis/base.py,sha256=R9Zy6rKKCw1LSAsBBBaBbgFEo6Fkdx8DTtp7bsYoywE,3309
@@ -81,7 +82,7 @@ checkmate/lib/stats/helpers.py,sha256=X21Pb7dz3PWubDRoqUjbxwonl43TRxqKEcwyM80tS6
81
82
  checkmate/lib/stats/mapreduce.py,sha256=rGdA_HninEZSeowtBn5R02c6wyT5dxcu-0T2ftlMnY0,782
82
83
  checkmate/management/__init__.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
83
84
  checkmate/management/decorators.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
84
- checkmate/management/helpers.py,sha256=XSvNilmlDiw-qubAN2oVtMHcRz6VAMaOYmULfYLukvs,5403
85
+ checkmate/management/helpers.py,sha256=8AQ2qNBBJ16H4T4G5FolH9RhdLQ1adVdzxrkLEaxcsU,5411
85
86
  checkmate/management/commands/__init__.py,sha256=XAi0y8z1NviyGvLB68Oxnzr6Nw5AP8xgbcSSnc1Zcvw,766
86
87
  checkmate/management/commands/alembic.py,sha256=DTWH8hcY6UmWDo0wMwcID_wQIa-es7nyJHV6p1_T4FQ,718
87
88
  checkmate/management/commands/analyze.py,sha256=J1rawVEGjbrXT9ArfUVpfoLNs2JaFkV4mCrBnEIrXaw,1159
@@ -109,9 +110,9 @@ checkmate/scripts/manage.py,sha256=mpioBaxzirAKXZtbxO-y4dbOcc6UoP0MaAMsNuKHbz0,4
109
110
  checkmate/settings/__init__.py,sha256=z32hPz-kGS-tTGa6dWCFjrrrbS_eagLd-YrqBP3gjWI,33
110
111
  checkmate/settings/base.py,sha256=3WBXZITqoWepIja96bo5JTi-TDpQALPTCugL0E8z-yE,4551
111
112
  checkmate/settings/defaults.py,sha256=HJoZIin2BHT_gBCngGZNh7WgSNLqIDTK--iW7hXez4Q,5084
112
- checkmate5-4.0.92.dist-info/LICENSE.txt,sha256=9cSf5btiPmglu3yzhXkXcf7GNT8XC9o7Y54tfhvfDp8,213739
113
- checkmate5-4.0.92.dist-info/METADATA,sha256=KMpTUwrZ2KV2_07ZoWCxbdndGqcEihZMDL6XLhdunlE,1234
114
- checkmate5-4.0.92.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
115
- checkmate5-4.0.92.dist-info/entry_points.txt,sha256=FbGnau5C4z98WmBYpMJqUzobQEr1AIi9aZApSavNojQ,60
116
- checkmate5-4.0.92.dist-info/top_level.txt,sha256=tl6eIJXedpLZbcbmYEwlhEzuTaSt0TvIRUesOb8gtng,10
117
- checkmate5-4.0.92.dist-info/RECORD,,
113
+ checkmate5-4.0.94.dist-info/LICENSE.txt,sha256=9cSf5btiPmglu3yzhXkXcf7GNT8XC9o7Y54tfhvfDp8,213739
114
+ checkmate5-4.0.94.dist-info/METADATA,sha256=4NQLq6ADtFGD-4pmZlAGN3EzOgJIfcDVSxbgxbre2vg,1234
115
+ checkmate5-4.0.94.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
116
+ checkmate5-4.0.94.dist-info/entry_points.txt,sha256=FbGnau5C4z98WmBYpMJqUzobQEr1AIi9aZApSavNojQ,60
117
+ checkmate5-4.0.94.dist-info/top_level.txt,sha256=tl6eIJXedpLZbcbmYEwlhEzuTaSt0TvIRUesOb8gtng,10
118
+ checkmate5-4.0.94.dist-info/RECORD,,