|
| 1 | +# Credo Configuration |
| 2 | +# |
| 3 | +# Strict configuration for Valence Shell. |
| 4 | +# Run with: mix credo --strict |
| 5 | + |
| 6 | +%{ |
| 7 | + configs: [ |
| 8 | + %{ |
| 9 | + name: "default", |
| 10 | + files: %{ |
| 11 | + included: [ |
| 12 | + "lib/", |
| 13 | + "test/" |
| 14 | + ], |
| 15 | + excluded: [ |
| 16 | + ~r"/_build/", |
| 17 | + ~r"/deps/", |
| 18 | + ~r"/priv/", |
| 19 | + ~r"/proofs/" |
| 20 | + ] |
| 21 | + }, |
| 22 | + plugins: [], |
| 23 | + requires: [], |
| 24 | + strict: true, |
| 25 | + parse_timeout: 5000, |
| 26 | + color: true, |
| 27 | + checks: %{ |
| 28 | + enabled: [ |
| 29 | + # Consistency |
| 30 | + {Credo.Check.Consistency.ExceptionNames, []}, |
| 31 | + {Credo.Check.Consistency.LineEndings, []}, |
| 32 | + {Credo.Check.Consistency.ParameterPatternMatching, []}, |
| 33 | + {Credo.Check.Consistency.SpaceAroundOperators, []}, |
| 34 | + {Credo.Check.Consistency.SpaceInParentheses, []}, |
| 35 | + {Credo.Check.Consistency.TabsOrSpaces, []}, |
| 36 | + |
| 37 | + # Design |
| 38 | + {Credo.Check.Design.AliasUsage, [priority: :low, if_nested_deeper_than: 2]}, |
| 39 | + {Credo.Check.Design.DuplicatedCode, [priority: :normal]}, |
| 40 | + {Credo.Check.Design.TagTODO, [exit_status: 0]}, # Warn but don't fail |
| 41 | + {Credo.Check.Design.TagFIXME, []}, |
| 42 | + |
| 43 | + # Readability |
| 44 | + {Credo.Check.Readability.AliasOrder, []}, |
| 45 | + {Credo.Check.Readability.FunctionNames, []}, |
| 46 | + {Credo.Check.Readability.LargeNumbers, []}, |
| 47 | + {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, |
| 48 | + {Credo.Check.Readability.ModuleAttributeNames, []}, |
| 49 | + {Credo.Check.Readability.ModuleDoc, []}, |
| 50 | + {Credo.Check.Readability.ModuleNames, []}, |
| 51 | + {Credo.Check.Readability.ParenthesesInCondition, []}, |
| 52 | + {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, |
| 53 | + {Credo.Check.Readability.PipeIntoAnonymousFunctions, []}, |
| 54 | + {Credo.Check.Readability.PredicateFunctionNames, []}, |
| 55 | + {Credo.Check.Readability.PreferImplicitTry, []}, |
| 56 | + {Credo.Check.Readability.RedundantBlankLines, []}, |
| 57 | + {Credo.Check.Readability.Semicolons, []}, |
| 58 | + {Credo.Check.Readability.SpaceAfterCommas, []}, |
| 59 | + {Credo.Check.Readability.StringSigils, []}, |
| 60 | + {Credo.Check.Readability.TrailingBlankLine, []}, |
| 61 | + {Credo.Check.Readability.TrailingWhiteSpace, []}, |
| 62 | + {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, |
| 63 | + {Credo.Check.Readability.VariableNames, []}, |
| 64 | + {Credo.Check.Readability.WithSingleClause, []}, |
| 65 | + |
| 66 | + # Refactoring |
| 67 | + {Credo.Check.Refactor.Apply, []}, |
| 68 | + {Credo.Check.Refactor.CondStatements, []}, |
| 69 | + {Credo.Check.Refactor.CyclomaticComplexity, [max_complexity: 10]}, |
| 70 | + {Credo.Check.Refactor.FunctionArity, [max_arity: 6]}, |
| 71 | + {Credo.Check.Refactor.LongQuoteBlocks, []}, |
| 72 | + {Credo.Check.Refactor.MatchInCondition, []}, |
| 73 | + {Credo.Check.Refactor.MapJoin, []}, |
| 74 | + {Credo.Check.Refactor.NegatedConditionsInUnless, []}, |
| 75 | + {Credo.Check.Refactor.NegatedConditionsWithElse, []}, |
| 76 | + {Credo.Check.Refactor.Nesting, [max_nesting: 3]}, |
| 77 | + {Credo.Check.Refactor.UnlessWithElse, []}, |
| 78 | + {Credo.Check.Refactor.WithClauses, []}, |
| 79 | + |
| 80 | + # Warnings |
| 81 | + {Credo.Check.Warning.BoolOperationOnSameValues, []}, |
| 82 | + {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, |
| 83 | + {Credo.Check.Warning.IExPry, []}, |
| 84 | + {Credo.Check.Warning.IoInspect, []}, |
| 85 | + {Credo.Check.Warning.OperationOnSameValues, []}, |
| 86 | + {Credo.Check.Warning.OperationWithConstantResult, []}, |
| 87 | + {Credo.Check.Warning.RaiseInsideRescue, []}, |
| 88 | + {Credo.Check.Warning.SpecWithStruct, []}, |
| 89 | + {Credo.Check.Warning.UnusedEnumOperation, []}, |
| 90 | + {Credo.Check.Warning.UnusedFileOperation, []}, |
| 91 | + {Credo.Check.Warning.UnusedKeywordOperation, []}, |
| 92 | + {Credo.Check.Warning.UnusedListOperation, []}, |
| 93 | + {Credo.Check.Warning.UnusedPathOperation, []}, |
| 94 | + {Credo.Check.Warning.UnusedRegexOperation, []}, |
| 95 | + {Credo.Check.Warning.UnusedStringOperation, []}, |
| 96 | + {Credo.Check.Warning.UnusedTupleOperation, []}, |
| 97 | + {Credo.Check.Warning.UnsafeExec, []} |
| 98 | + ], |
| 99 | + disabled: [ |
| 100 | + # These are optional extras |
| 101 | + {Credo.Check.Readability.StrictModuleLayout, []}, |
| 102 | + {Credo.Check.Refactor.ABCSize, []}, |
| 103 | + {Credo.Check.Refactor.AppendSingleItem, []}, |
| 104 | + {Credo.Check.Refactor.DoubleBooleanNegation, []}, |
| 105 | + {Credo.Check.Refactor.ModuleDependencies, []}, |
| 106 | + {Credo.Check.Refactor.NegatedIsNil, []}, |
| 107 | + {Credo.Check.Refactor.PipeChainStart, []}, |
| 108 | + {Credo.Check.Refactor.VariableRebinding, []}, |
| 109 | + {Credo.Check.Warning.LazyLogging, []}, |
| 110 | + {Credo.Check.Warning.LeakyEnvironment, []}, |
| 111 | + {Credo.Check.Warning.MapGetUnsafePass, []}, |
| 112 | + {Credo.Check.Warning.MixEnv, []}, |
| 113 | + {Credo.Check.Warning.UnsafeToAtom, []} |
| 114 | + ] |
| 115 | + } |
| 116 | + } |
| 117 | + ] |
| 118 | +} |
0 commit comments