-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.scalafix.conf
More file actions
69 lines (66 loc) · 2.25 KB
/
Copy path.scalafix.conf
File metadata and controls
69 lines (66 loc) · 2.25 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
rules = [
OrganizeImports,
DisableSyntax,
LeakingImplicitClassVal,
NoAutoTupling,
NoValInForComprehension,
ProcedureSyntax,
RemoveUnused
]
DisableSyntax.noVars = true
DisableSyntax.noThrows = true
DisableSyntax.noNulls = true
DisableSyntax.noReturns = true
DisableSyntax.noWhileLoops = true
# asInstanceOf checked with whitelist in CI (scalafix doesn't support per-file excludes)
DisableSyntax.noIsInstanceOf = true
DisableSyntax.noXml = true
DisableSyntax.regex = [
{
id = noTryBlocks
pattern = "\\btry\\s*\\{"
message = "Use Safety.safely / EffectSystem.bracket/handleError instead of try/catch."
},
{
id = noScalaUtilTry
pattern = "\\bscala\\.util\\.Try\\b"
message = "Use Safety.safely / EffectSystem.attempt instead of scala.util.Try."
},
{
id = noPrintln
pattern = "\\b(println|print)\\s*\\("
message = "Use structured logging (Logger) instead of println/print in production code."
},
{
id = noSystemOut
pattern = "System\\.out\\.(println|print)"
message = "Use structured logging (Logger) instead of System.out in production code."
},
{
id = noConsolePrintln
pattern = "Console\\.(println|print)"
message = "Use structured logging (Logger) instead of Console.println in production code."
},
{
id = noUnsafeRunSync
pattern = "\\bunsafeRunSync\\b"
message = "Use IOApp or Resource.use to safely run effects at edges (ADR-022)."
},
{
id = noShadow_Cats_toValidatedNel
# Only flags definitions, not calls. Prevents redefining Cats syntax
# (ADR-025: Shadowing Cats syntax causes recursion/ambiguity).
pattern = "\\bdef\\s+toValidatedNel\\b"
message = "Do not define toValidatedNel; use Cats EitherOps.toValidatedNel or name differently (ADR-025)."
},
{
id = noShadow_Cats_toValidated
pattern = "\\bdef\\s+toValidated\\b"
message = "Do not define toValidated; use Cats EitherOps.toValidated or name differently (ADR-025)."
}
]
OrganizeImports.removeUnused = true
OrganizeImports.groupedImports = Merge
# Note: Scalafix DisableSyntax doesn't support per-file excludes
# Whitelists for asInstanceOf and scala.util.Try are enforced via shell scripts in CI
# Examples directory is excluded from CI checks via grep filter (demo code, not production)