|
| 1 | +%{ |
| 2 | + configs: [ |
| 3 | + %{ |
| 4 | + name: "default", |
| 5 | + files: %{ |
| 6 | + # |
| 7 | + # You can give explicit globs or simply directories. |
| 8 | + # In the latter case `**/*.{ex,exs}` will be used. |
| 9 | + # |
| 10 | + included: ["."], |
| 11 | + excluded: [~r"/_build/", ~r"/deps/"] |
| 12 | + }, |
| 13 | + requires: [], |
| 14 | + strict: true, |
| 15 | + color: true, |
| 16 | + checks: [ |
| 17 | + {Credo.Check.Consistency.ExceptionNames}, |
| 18 | + {Credo.Check.Consistency.LineEndings}, |
| 19 | + {Credo.Check.Consistency.ParameterPatternMatching}, |
| 20 | + {Credo.Check.Consistency.SpaceAroundOperators}, |
| 21 | + {Credo.Check.Consistency.SpaceInParentheses}, |
| 22 | + {Credo.Check.Consistency.TabsOrSpaces}, |
| 23 | + |
| 24 | + # You can customize the priority of any check |
| 25 | + # Priority values are: `low, normal, high, higher` |
| 26 | + # |
| 27 | + {Credo.Check.Design.AliasUsage, priority: :low}, |
| 28 | + |
| 29 | + # For some checks, you can also set other parameters |
| 30 | + # |
| 31 | + # If you don't want the `setup` and `test` macro calls in ExUnit tests |
| 32 | + # or the `schema` macro in Ecto schemas to trigger DuplicatedCode, just |
| 33 | + # set the `excluded_macros` parameter to `[:schema, :setup, :test]`. |
| 34 | + # |
| 35 | + {Credo.Check.Design.DuplicatedCode, excluded_macros: []}, |
| 36 | + {Credo.Check.Design.TagTODO, exit_status: 2}, |
| 37 | + {Credo.Check.Design.TagFIXME}, |
| 38 | + |
| 39 | + {Credo.Check.Readability.FunctionNames}, |
| 40 | + {Credo.Check.Readability.LargeNumbers}, |
| 41 | + {Credo.Check.Readability.MaxLineLength, priority: :low, max_length: 80}, |
| 42 | + {Credo.Check.Readability.ModuleAttributeNames}, |
| 43 | + {Credo.Check.Readability.ModuleDoc}, |
| 44 | + {Credo.Check.Readability.ModuleNames}, |
| 45 | + {Credo.Check.Readability.ParenthesesOnZeroArityDefs}, |
| 46 | + {Credo.Check.Readability.ParenthesesInCondition}, |
| 47 | + {Credo.Check.Readability.PredicateFunctionNames}, |
| 48 | + {Credo.Check.Readability.PreferImplicitTry}, |
| 49 | + {Credo.Check.Readability.RedundantBlankLines}, |
| 50 | + {Credo.Check.Readability.StringSigils}, |
| 51 | + {Credo.Check.Readability.TrailingBlankLine}, |
| 52 | + {Credo.Check.Readability.TrailingWhiteSpace}, |
| 53 | + {Credo.Check.Readability.VariableNames}, |
| 54 | + {Credo.Check.Readability.Semicolons}, |
| 55 | + {Credo.Check.Readability.SpaceAfterCommas}, |
| 56 | + |
| 57 | + {Credo.Check.Refactor.DoubleBooleanNegation}, |
| 58 | + {Credo.Check.Refactor.CondStatements}, |
| 59 | + {Credo.Check.Refactor.CyclomaticComplexity}, |
| 60 | + {Credo.Check.Refactor.FunctionArity}, |
| 61 | + {Credo.Check.Refactor.LongQuoteBlocks}, |
| 62 | + {Credo.Check.Refactor.MatchInCondition}, |
| 63 | + {Credo.Check.Refactor.NegatedConditionsInUnless}, |
| 64 | + {Credo.Check.Refactor.NegatedConditionsWithElse}, |
| 65 | + {Credo.Check.Refactor.Nesting}, |
| 66 | + {Credo.Check.Refactor.PipeChainStart}, |
| 67 | + {Credo.Check.Refactor.UnlessWithElse}, |
| 68 | + |
| 69 | + {Credo.Check.Warning.BoolOperationOnSameValues}, |
| 70 | + {Credo.Check.Warning.ExpensiveEmptyEnumCheck}, |
| 71 | + {Credo.Check.Warning.IExPry}, |
| 72 | + {Credo.Check.Warning.IoInspect}, |
| 73 | + {Credo.Check.Warning.LazyLogging}, |
| 74 | + {Credo.Check.Warning.OperationOnSameValues}, |
| 75 | + {Credo.Check.Warning.OperationWithConstantResult}, |
| 76 | + {Credo.Check.Warning.UnusedEnumOperation}, |
| 77 | + {Credo.Check.Warning.UnusedFileOperation}, |
| 78 | + {Credo.Check.Warning.UnusedKeywordOperation}, |
| 79 | + {Credo.Check.Warning.UnusedListOperation}, |
| 80 | + {Credo.Check.Warning.UnusedPathOperation}, |
| 81 | + {Credo.Check.Warning.UnusedRegexOperation}, |
| 82 | + {Credo.Check.Warning.UnusedStringOperation}, |
| 83 | + {Credo.Check.Warning.UnusedTupleOperation}, |
| 84 | + {Credo.Check.Warning.RaiseInsideRescue}, |
| 85 | + |
| 86 | + # Controversial and experimental checks (opt-in, just remove `, false`) |
| 87 | + # |
| 88 | + {Credo.Check.Refactor.ABCSize, false}, |
| 89 | + {Credo.Check.Refactor.AppendSingleItem, false}, |
| 90 | + {Credo.Check.Refactor.VariableRebinding, false}, |
| 91 | + {Credo.Check.Warning.MapGetUnsafePass, false}, |
| 92 | + {Credo.Check.Consistency.MultiAliasImportRequireUse, false}, |
| 93 | + |
| 94 | + # Deprecated checks (these will be deleted after a grace period) |
| 95 | + # |
| 96 | + {Credo.Check.Readability.Specs, false}, |
| 97 | + {Credo.Check.Warning.NameRedeclarationByAssignment, false}, |
| 98 | + {Credo.Check.Warning.NameRedeclarationByCase, false}, |
| 99 | + {Credo.Check.Warning.NameRedeclarationByDef, false}, |
| 100 | + {Credo.Check.Warning.NameRedeclarationByFn, false}, |
| 101 | + |
| 102 | + # Custom checks can be created using `mix credo.gen.check`. |
| 103 | + # |
| 104 | + ] |
| 105 | + } |
| 106 | + ] |
| 107 | +} |
0 commit comments