|
| 1 | +%{ |
| 2 | + configs: [ |
| 3 | + %{ |
| 4 | + name: "default", |
| 5 | + files: %{ |
| 6 | + included: [ |
| 7 | + "lib/", |
| 8 | + "src/", |
| 9 | + "test/", |
| 10 | + "web/" |
| 11 | + ], |
| 12 | + excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] |
| 13 | + }, |
| 14 | + plugins: [], |
| 15 | + requires: [], |
| 16 | + strict: true, |
| 17 | + parse_timeout: 5000, |
| 18 | + color: false, |
| 19 | + checks: %{ |
| 20 | + enabled: [ |
| 21 | + # |
| 22 | + ## Consistency Checks |
| 23 | + # |
| 24 | + {Credo.Check.Consistency.ExceptionNames, []}, |
| 25 | + {Credo.Check.Consistency.LineEndings, []}, |
| 26 | + {Credo.Check.Consistency.ParameterPatternMatching, []}, |
| 27 | + {Credo.Check.Consistency.SpaceAroundOperators, []}, |
| 28 | + {Credo.Check.Consistency.SpaceInParentheses, []}, |
| 29 | + {Credo.Check.Consistency.TabsOrSpaces, []}, |
| 30 | + |
| 31 | + # |
| 32 | + ## Design Checks |
| 33 | + # |
| 34 | + # You can customize the priority of any check |
| 35 | + # Priority values are: `low, normal, high, higher` |
| 36 | + # |
| 37 | + {Credo.Check.Design.AliasUsage, |
| 38 | + [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]}, |
| 39 | + {Credo.Check.Design.TagFIXME, []}, |
| 40 | + # You can also customize the exit_status of each check. |
| 41 | + # If you don't want TODO comments to cause `mix credo` to fail, just |
| 42 | + # set this value to 0 (zero). |
| 43 | + # |
| 44 | + {Credo.Check.Design.TagTODO, [exit_status: 2]}, |
| 45 | + |
| 46 | + # |
| 47 | + ## Readability Checks |
| 48 | + # |
| 49 | + {Credo.Check.Readability.AliasOrder, []}, |
| 50 | + {Credo.Check.Readability.FunctionNames, []}, |
| 51 | + {Credo.Check.Readability.LargeNumbers, []}, |
| 52 | + {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, |
| 53 | + {Credo.Check.Readability.ModuleAttributeNames, []}, |
| 54 | + {Credo.Check.Readability.ModuleDoc, []}, |
| 55 | + {Credo.Check.Readability.ModuleNames, []}, |
| 56 | + {Credo.Check.Readability.ParenthesesInCondition, []}, |
| 57 | + {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, |
| 58 | + {Credo.Check.Readability.PipeIntoAnonymousFunctions, []}, |
| 59 | + {Credo.Check.Readability.PredicateFunctionNames, []}, |
| 60 | + {Credo.Check.Readability.PreferImplicitTry, []}, |
| 61 | + {Credo.Check.Readability.RedundantBlankLines, []}, |
| 62 | + {Credo.Check.Readability.Semicolons, []}, |
| 63 | + {Credo.Check.Readability.SpaceAfterCommas, []}, |
| 64 | + {Credo.Check.Readability.StringSigils, []}, |
| 65 | + {Credo.Check.Readability.TrailingBlankLine, []}, |
| 66 | + {Credo.Check.Readability.TrailingWhiteSpace, []}, |
| 67 | + {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, |
| 68 | + {Credo.Check.Readability.VariableNames, []}, |
| 69 | + {Credo.Check.Readability.WithSingleClause, []}, |
| 70 | + |
| 71 | + # |
| 72 | + ## Refactoring Opportunities |
| 73 | + # |
| 74 | + {Credo.Check.Refactor.Apply, []}, |
| 75 | + {Credo.Check.Refactor.CondStatements, []}, |
| 76 | + {Credo.Check.Refactor.CyclomaticComplexity, []}, |
| 77 | + {Credo.Check.Refactor.FilterCount, []}, |
| 78 | + {Credo.Check.Refactor.FilterFilter, []}, |
| 79 | + {Credo.Check.Refactor.FunctionArity, []}, |
| 80 | + {Credo.Check.Refactor.LongQuoteBlocks, []}, |
| 81 | + {Credo.Check.Refactor.MapJoin, []}, |
| 82 | + {Credo.Check.Refactor.MatchInCondition, []}, |
| 83 | + {Credo.Check.Refactor.NegatedConditionsInUnless, []}, |
| 84 | + {Credo.Check.Refactor.NegatedConditionsWithElse, []}, |
| 85 | + {Credo.Check.Refactor.Nesting, []}, |
| 86 | + {Credo.Check.Refactor.RedundantWithClauseResult, []}, |
| 87 | + {Credo.Check.Refactor.RejectReject, []}, |
| 88 | + {Credo.Check.Refactor.UnlessWithElse, []}, |
| 89 | + {Credo.Check.Refactor.WithClauses, []}, |
| 90 | + |
| 91 | + # |
| 92 | + ## Warnings |
| 93 | + # |
| 94 | + {Credo.Check.Warning.ApplicationConfigInModuleAttribute, []}, |
| 95 | + {Credo.Check.Warning.BoolOperationOnSameValues, []}, |
| 96 | + {Credo.Check.Warning.Dbg, []}, |
| 97 | + {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, |
| 98 | + {Credo.Check.Warning.IExPry, []}, |
| 99 | + {Credo.Check.Warning.IoInspect, []}, |
| 100 | + {Credo.Check.Warning.MissedMetadataKeyInLoggerConfig, []}, |
| 101 | + {Credo.Check.Warning.OperationOnSameValues, []}, |
| 102 | + {Credo.Check.Warning.OperationWithConstantResult, []}, |
| 103 | + {Credo.Check.Warning.RaiseInsideRescue, []}, |
| 104 | + {Credo.Check.Warning.SpecWithStruct, []}, |
| 105 | + {Credo.Check.Warning.UnsafeExec, []}, |
| 106 | + {Credo.Check.Warning.UnusedEnumOperation, []}, |
| 107 | + {Credo.Check.Warning.UnusedFileOperation, []}, |
| 108 | + {Credo.Check.Warning.UnusedKeywordOperation, []}, |
| 109 | + {Credo.Check.Warning.UnusedListOperation, []}, |
| 110 | + {Credo.Check.Warning.UnusedPathOperation, []}, |
| 111 | + {Credo.Check.Warning.UnusedRegexOperation, []}, |
| 112 | + {Credo.Check.Warning.UnusedStringOperation, []}, |
| 113 | + {Credo.Check.Warning.UnusedTupleOperation, []}, |
| 114 | + {Credo.Check.Warning.WrongTestFileExtension, []} |
| 115 | + ], |
| 116 | + disabled: [ |
| 117 | + # |
| 118 | + # Checks scheduled for next check update (opt-in for now) |
| 119 | + {Credo.Check.Refactor.UtcNowTruncate, []}, |
| 120 | + |
| 121 | + # |
| 122 | + # Controversial and experimental checks (opt-in, just move the check to `:enabled` |
| 123 | + # and be sure to use `mix credo --strict` to see low priority checks) |
| 124 | + # |
| 125 | + {Credo.Check.Consistency.MultiAliasImportRequireUse, []}, |
| 126 | + {Credo.Check.Consistency.UnusedVariableNames, []}, |
| 127 | + {Credo.Check.Design.DuplicatedCode, []}, |
| 128 | + {Credo.Check.Design.SkipTestWithoutComment, []}, |
| 129 | + {Credo.Check.Readability.AliasAs, []}, |
| 130 | + {Credo.Check.Readability.BlockPipe, []}, |
| 131 | + {Credo.Check.Readability.ImplTrue, []}, |
| 132 | + {Credo.Check.Readability.MultiAlias, []}, |
| 133 | + {Credo.Check.Readability.NestedFunctionCalls, []}, |
| 134 | + {Credo.Check.Readability.OneArityFunctionInPipe, []}, |
| 135 | + {Credo.Check.Readability.OnePipePerLine, []}, |
| 136 | + {Credo.Check.Readability.SeparateAliasRequire, []}, |
| 137 | + {Credo.Check.Readability.SingleFunctionToBlockPipe, []}, |
| 138 | + {Credo.Check.Readability.SinglePipe, []}, |
| 139 | + {Credo.Check.Readability.Specs, []}, |
| 140 | + {Credo.Check.Readability.StrictModuleLayout, []}, |
| 141 | + {Credo.Check.Readability.WithCustomTaggedTuple, []}, |
| 142 | + {Credo.Check.Refactor.ABCSize, []}, |
| 143 | + {Credo.Check.Refactor.AppendSingleItem, []}, |
| 144 | + {Credo.Check.Refactor.DoubleBooleanNegation, []}, |
| 145 | + {Credo.Check.Refactor.FilterReject, []}, |
| 146 | + {Credo.Check.Refactor.IoPuts, []}, |
| 147 | + {Credo.Check.Refactor.MapMap, []}, |
| 148 | + {Credo.Check.Refactor.ModuleDependencies, []}, |
| 149 | + {Credo.Check.Refactor.NegatedIsNil, []}, |
| 150 | + {Credo.Check.Refactor.PassAsyncInTestCases, []}, |
| 151 | + {Credo.Check.Refactor.PipeChainStart, []}, |
| 152 | + {Credo.Check.Refactor.RejectFilter, []}, |
| 153 | + {Credo.Check.Refactor.VariableRebinding, []}, |
| 154 | + {Credo.Check.Warning.LazyLogging, []}, |
| 155 | + {Credo.Check.Warning.LeakyEnvironment, []}, |
| 156 | + {Credo.Check.Warning.MapGetUnsafePass, []}, |
| 157 | + {Credo.Check.Warning.MixEnv, []}, |
| 158 | + {Credo.Check.Warning.UnsafeToAtom, []} |
| 159 | + |
| 160 | + # {Credo.Check.Refactor.MapInto, []}, |
| 161 | + |
| 162 | + # |
| 163 | + # Custom checks can be created using `mix credo.gen.check`. |
| 164 | + # |
| 165 | + ] |
| 166 | + } |
| 167 | + } |
| 168 | + ] |
| 169 | +} |
0 commit comments