sqlclean 0.2.0__py3-none-any.whl → 0.3.0__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.
- sqlclean/rules/_helpers/definition.py +2 -2
- sqlclean/rules/constants.py +1 -1
- {sqlclean-0.2.0.dist-info → sqlclean-0.3.0.dist-info}/METADATA +4 -4
- {sqlclean-0.2.0.dist-info → sqlclean-0.3.0.dist-info}/RECORD +6 -6
- {sqlclean-0.2.0.dist-info → sqlclean-0.3.0.dist-info}/WHEEL +0 -0
- {sqlclean-0.2.0.dist-info → sqlclean-0.3.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -41,7 +41,7 @@ def define_rule(
|
|
|
41
41
|
if not is_custom_code(code):
|
|
42
42
|
raise RuleDefinitionError(
|
|
43
43
|
f"custom Rule code must be {CUSTOM_CODE_PREFIX}, optional capital letters and "
|
|
44
|
-
f"{RULE_CODE_DIGIT_COUNT} digits, such as
|
|
44
|
+
f"{RULE_CODE_DIGIT_COUNT} digits, such as XSQLCLEANNAME001: {code}"
|
|
45
45
|
)
|
|
46
46
|
names: list[str] = [option.name for option in options]
|
|
47
47
|
if len(names) != len(set(names)):
|
|
@@ -70,7 +70,7 @@ def define_rule(
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
def is_custom_code(code: str) -> bool:
|
|
73
|
-
"""Return whether code is
|
|
73
|
+
"""Return whether code is XSQLCLEAN, optional capital letters and three digits."""
|
|
74
74
|
|
|
75
75
|
family: str = code[:-RULE_CODE_DIGIT_COUNT]
|
|
76
76
|
number: str = code[-RULE_CODE_DIGIT_COUNT:]
|
sqlclean/rules/constants.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Constants of the custom Rule authoring API."""
|
|
2
2
|
|
|
3
3
|
RULE_ATTRIBUTE: str = "__sqlclean_rule__"
|
|
4
|
-
CUSTOM_CODE_PREFIX: str = "
|
|
4
|
+
CUSTOM_CODE_PREFIX: str = "XSQLCLEAN"
|
|
5
5
|
RULE_CODE_DIGIT_COUNT: int = 3
|
|
6
6
|
RULE_PARAMETER_COUNT: int = 2
|
|
7
7
|
SIGNATURE_REQUIREMENT: str = (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: sqlclean
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Fast, opinionated SQL linting and deterministic formatting, with custom Rules in Python
|
|
5
5
|
Project-URL: Homepage, https://github.com/sqlstack-io/sqlclean
|
|
6
6
|
Project-URL: Issues, https://github.com/sqlstack-io/sqlclean/issues
|
|
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Rust
|
|
|
17
17
|
Classifier: Programming Language :: SQL
|
|
18
18
|
Classifier: Topic :: Software Development :: Quality Assurance
|
|
19
19
|
Requires-Python: >=3.12
|
|
20
|
-
Requires-Dist: sqlclean-cli==0.
|
|
20
|
+
Requires-Dist: sqlclean-cli==0.3.0
|
|
21
21
|
Provides-Extra: ast
|
|
22
22
|
Requires-Dist: polyglot-sql-chio==0.13.10; extra == 'ast'
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
@@ -91,7 +91,7 @@ SQLClean in other configurations, on the same files:
|
|
|
91
91
|
|
|
92
92
|
| SQLClean command | Wall time |
|
|
93
93
|
|---|---:|
|
|
94
|
-
| `sqlclean check --select
|
|
94
|
+
| `sqlclean check --select SQLCLEAN` (every built-in Rule) | 1.33 s |
|
|
95
95
|
| `sqlclean check` plus three custom Python Rules | 2.27 s |
|
|
96
96
|
| `sqlclean check` rerun with nothing changed (result cache) | 0.23 s |
|
|
97
97
|
|
|
@@ -138,7 +138,7 @@ def lowered(operand: ast.Expression) -> bool:
|
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
@rule(
|
|
141
|
-
code="
|
|
141
|
+
code="XSQLCLEANTEAM001",
|
|
142
142
|
message="Email comparisons must be case-insensitive",
|
|
143
143
|
remediation="Compare LOWER(email) with LOWER(...) instead.",
|
|
144
144
|
enabled_by_default=True,
|
|
@@ -23,18 +23,18 @@ sqlclean/rule_testing/_helpers/native_facts.py,sha256=_3xSyJXE1atfvR5lphM3l974I3
|
|
|
23
23
|
sqlclean/rule_testing/main/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
24
|
sqlclean/rule_testing/main/evaluate_rule.py,sha256=dBrfALlyI9IXXu_7xUyNmUPC6iTQN1ZTHfWaWLnVAkc,436
|
|
25
25
|
sqlclean/rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
-
sqlclean/rules/constants.py,sha256=
|
|
26
|
+
sqlclean/rules/constants.py,sha256=0GIm_jg1TKSgFd11GxmZznfznB-PvIL6zLmEKzk-ZUU,474
|
|
27
27
|
sqlclean/rules/exceptions.py,sha256=-dN2vR9OAZl8jn5DdsEqIfgRHa5I9f4WWopHNK_QUmk,407
|
|
28
28
|
sqlclean/rules/models.py,sha256=YqBf6znFwnr18StijAsDEQK9bEBwAyORQkMmBPCMOlI,4172
|
|
29
29
|
sqlclean/rules/types.py,sha256=KbYp7k__QxhxLq9oR5zANI5GG2e9L9iNsM9ZkwukRI0,801
|
|
30
30
|
sqlclean/rules/_helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
sqlclean/rules/_helpers/definition.py,sha256=
|
|
31
|
+
sqlclean/rules/_helpers/definition.py,sha256=Rn3Gnly6f9B1OwowLRReNMOLwDvfN-W3yRAwFnEpxqI,4136
|
|
32
32
|
sqlclean/rules/classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
sqlclean/rules/classes/rule_context.py,sha256=DKZBitEPGuGTB3O61BrgTwa7TbXJcTHt6f6tVcXCQnk,3540
|
|
34
34
|
sqlclean/rules/classes/rule_option.py,sha256=awun7S7rk_hPsjP0wXFZhnGCKmnVx9pIHUucONUbjIc,4651
|
|
35
35
|
sqlclean/rules/main/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
36
|
sqlclean/rules/main/define.py,sha256=iMjEd_bd0MTkgWIbUafYOIVKIe3boupa5pK_3K9tSrU,915
|
|
37
|
-
sqlclean-0.
|
|
38
|
-
sqlclean-0.
|
|
39
|
-
sqlclean-0.
|
|
40
|
-
sqlclean-0.
|
|
37
|
+
sqlclean-0.3.0.dist-info/METADATA,sha256=AeVupIRFQ4hNaPcRHsn1qn0uJWkrLNXXG4Dzd17_Jsc,8668
|
|
38
|
+
sqlclean-0.3.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
39
|
+
sqlclean-0.3.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
40
|
+
sqlclean-0.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|