Repository navigation
Expand file tree
/
Copy pathfensu.toml
More file actions
125 lines (113 loc) · 4.38 KB
/
Copy pathfensu.toml
File metadata and controls
125 lines (113 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
[targets.python]
analyzer = "python"
roots = ["recorder/src/sqlquack_record", "python/src/sqlquack"]
tests = ["tests"]
tooling = ["scripts"]
rule_modules = ["scripts.fensu_policy.rules.script_names"]
select = ["FF", "XSQ005", "XSQ006"]
[targets.rust]
analyzer = "rust"
roots = ["crates", "tools"]
tests = []
tooling = []
rule_packs = ["rust"]
rule_modules = [
"scripts.fensu_policy.rules.crate_layout",
"scripts.fensu_policy.rules.dialect_folders",
"scripts.fensu_policy.rules.dialect_names",
"scripts.fensu_policy.rules.conversion_fields",
]
select = ["FPRS", "XSQ001", "XSQ002", "XSQ003", "XSQ004", "XSQ007", "XSQ008", "XSQ009"]
# The playground engine, website/wasm, imports these two Snowflake conversion entries. fensu reads
# only the root cargo workspace, and website/wasm keeps its own, so FPRSL105 cannot see that importer.
# Drop both entries once the playground engine moves onto the Snowflake pipeline's `analyze`.
[[targets.rust.rule_exceptions]]
rule = "FPRSL105"
path = "crates/sqlquack-convert/src/snowflake/conversion/main/convert_statement.rs"
reason = "imported by the playground engine website/wasm, outside the root cargo workspace, until the playground engine moves onto `analyze`"
[[targets.rust.rule_exceptions]]
rule = "FPRSL105"
path = "crates/sqlquack-convert/src/snowflake/conversion/main/within_budget.rs"
reason = "imported by the playground engine website/wasm, outside the root cargo workspace, until the playground engine moves onto `analyze`"
[[targets.rust.rule_exceptions]]
rule = "FPRSL105"
path = "crates/sqlquack-convert/src/snowflake/session/main/builtin_conversion_options.rs"
reason = "imported by the playground engine website/wasm, outside the root cargo workspace, which lists each known difference's default from it"
[[targets.rust.rule_exceptions]]
rule = "FPRSL105"
path = "crates/sqlquack-convert/src/snowflake/session/main/configured_choices.rs"
reason = "imported by the playground engine website/wasm, outside the root cargo workspace, which reads the user's sqlquack.toml text without a file"
# The evidence policy sits at the crate root, where `cargo package` keeps it and the evidence commands
# read it, so the constant that compiles it in reaches outside src/policy/.
[[targets.rust.rule_exceptions]]
rule = "FPRSL106"
path = "crates/sqlquack-policy/src/policy/constants.rs"
reason = "compiles in crates/sqlquack-policy/policy.toml, which sits at the crate root for `cargo package` and the evidence commands"
# Format, lint and fingerprint take a dialect at run time, so each keeps one registry that maps
# a dialect value to its src/<dialect>/ profile, with every line behind that dialect's feature.
[targets.rust.rule_options.XSQ007]
dialect_registries = [
"crates/sqlquack-semantics/src/dialects",
"crates/sqlquack-format/src/dialects",
"crates/sqlquack-lint/src/dialects",
"crates/sqlquack-fingerprint/src/dialects",
]
# A crate that is also a Python distribution keeps its pyproject.toml and shipped notices beside Cargo.toml,
# and sqlquack-policy keeps the policy.toml it compiles in, so `cargo package` includes it.
[targets.rust.rule_options.FPRSR311]
allowed_entries = [
"Cargo.toml",
"build.rs",
"src/",
"tests/",
"benches/",
"examples/",
"README*",
"LICENSE*",
"THIRD_PARTY_NOTICES",
"pyproject.toml",
"policy.toml",
]
# Layer: only the command-line crates may depend on the conversion rules and pipeline.
[targets.rust_rules_layer]
analyzer = "rust"
roots = ["crates", "tools"]
tests = []
tooling = [
"crates/sqlquack",
"crates/sqlquack-convert",
"crates/sqlquack-python",
]
rule_packs = ["rust"]
select = ["FPRSL301"]
[targets.rust_rules_layer.rule_options.FPRSL301]
forbidden_packages = ["sqlquack-convert"]
# Layer: syntax, the parsers, diagnostics and semantics build without conversion, DuckDB or evidence.
[targets.rust_analysis_layer]
analyzer = "rust"
roots = ["crates", "tools"]
tests = []
tooling = [
"crates/sqlquack",
"crates/sqlquack-convert",
"crates/sqlquack-python",
"crates/sqlquack-blocks",
"crates/sqlquack-evidence",
"tools/sqlquack-format-check",
"crates/sqlquack-compare",
"crates/sqlquack-policy",
]
rule_packs = ["rust"]
select = ["FPRSL301"]
[targets.rust_analysis_layer.rule_options.FPRSL301]
forbidden_packages = [
"sqlquack",
"sqlquack-convert",
"sqlquack-blocks",
"sqlquack-evidence",
"sqlquack-compare",
"sqlquack-policy",
"duckdb",
"libduckdb-sys",
"arrow",
]