|
| 1 | +# This file contains the configuration for Credo. |
| 2 | +# |
| 3 | +# If you find anything wrong or unclear in this file, please report an |
| 4 | +# issue on GitHub: https://github.com/rrrene/credo/issues |
| 5 | +%{ |
| 6 | + # |
| 7 | + # You can have as many configs as you like in the `configs:` field. |
| 8 | + configs: [ |
| 9 | + %{ |
| 10 | + # |
| 11 | + # Run any config using `mix credo -C <name>`. If no config name is given |
| 12 | + # "default" is used. |
| 13 | + name: "default", |
| 14 | + # |
| 15 | + # these are the files included in the analysis |
| 16 | + files: %{ |
| 17 | + # |
| 18 | + # you can give explicit globs or simply directories |
| 19 | + # in the latter case `**/*.{ex,exs}` will be used |
| 20 | + included: ["lib/", "src/", "web/", "apps/"], |
| 21 | + excluded: [] |
| 22 | + }, |
| 23 | + # |
| 24 | + # The `checks:` field contains all the checks that are run. You can |
| 25 | + # customize the parameters of any given check by adding a second element |
| 26 | + # to the tuple. |
| 27 | + # |
| 28 | + # There are two ways of deactivating a check: |
| 29 | + # 1. deleting the check from this list |
| 30 | + # 2. putting `false` as second element (to quickly "comment it out"): |
| 31 | + # |
| 32 | + # {Credo.Check.Consistency.ExceptionNames, false} |
| 33 | + # |
| 34 | + checks: [ |
| 35 | + {Credo.Check.Consistency.ExceptionNames}, |
| 36 | + {Credo.Check.Consistency.LineEndings}, |
| 37 | + {Credo.Check.Consistency.SpaceAroundOperators}, |
| 38 | + {Credo.Check.Consistency.SpaceInParentheses}, |
| 39 | + {Credo.Check.Consistency.TabsOrSpaces}, |
| 40 | + |
| 41 | + # For some checks, like AliasUsage, you can only customize the priority |
| 42 | + # Priority values are: `low, normal, high, higher` |
| 43 | + {Credo.Check.Design.AliasUsage, priority: :low}, |
| 44 | + # For others you can set parameters |
| 45 | + {Credo.Check.Design.DuplicatedCode, mass_threshold: 16, nodes_threshold: 2}, |
| 46 | + |
| 47 | + # You can also customize the exit_status of each check. |
| 48 | + # If you don't want TODO comments to cause `mix credo` to fail, just |
| 49 | + # set this value to 0 (zero). |
| 50 | + {Credo.Check.Design.TagTODO, false}, |
| 51 | + {Credo.Check.Design.TagFIXME}, |
| 52 | + |
| 53 | + {Credo.Check.Readability.FunctionNames}, |
| 54 | + {Credo.Check.Readability.MaxLineLength, priority: :low, max_length: 120}, |
| 55 | + {Credo.Check.Readability.ModuleAttributeNames}, |
| 56 | + {Credo.Check.Readability.ModuleDoc}, |
| 57 | + {Credo.Check.Readability.ModuleNames}, |
| 58 | + {Credo.Check.Readability.PredicateFunctionNames}, |
| 59 | + {Credo.Check.Readability.TrailingBlankLine}, |
| 60 | + {Credo.Check.Readability.TrailingWhiteSpace}, |
| 61 | + {Credo.Check.Readability.VariableNames}, |
| 62 | + |
| 63 | + {Credo.Check.Refactor.ABCSize}, |
| 64 | + {Credo.Check.Refactor.CaseTrivialMatches}, |
| 65 | + {Credo.Check.Refactor.CondStatements}, |
| 66 | + {Credo.Check.Refactor.FunctionArity}, |
| 67 | + {Credo.Check.Refactor.MatchInCondition}, |
| 68 | + {Credo.Check.Refactor.PipeChainStart}, |
| 69 | + {Credo.Check.Refactor.CyclomaticComplexity}, |
| 70 | + {Credo.Check.Refactor.NegatedConditionsInUnless}, |
| 71 | + {Credo.Check.Refactor.NegatedConditionsWithElse}, |
| 72 | + {Credo.Check.Refactor.Nesting}, |
| 73 | + {Credo.Check.Refactor.UnlessWithElse}, |
| 74 | + |
| 75 | + {Credo.Check.Warning.IExPry}, |
| 76 | + {Credo.Check.Warning.IoInspect}, |
| 77 | + {Credo.Check.Warning.NameRedeclarationByAssignment}, |
| 78 | + {Credo.Check.Warning.NameRedeclarationByCase}, |
| 79 | + {Credo.Check.Warning.NameRedeclarationByDef}, |
| 80 | + {Credo.Check.Warning.NameRedeclarationByFn}, |
| 81 | + {Credo.Check.Warning.OperationOnSameValues}, |
| 82 | + {Credo.Check.Warning.UnusedEnumOperation}, |
| 83 | + {Credo.Check.Warning.UnusedKeywordOperation}, |
| 84 | + {Credo.Check.Warning.UnusedListOperation}, |
| 85 | + {Credo.Check.Warning.UnusedStringOperation}, |
| 86 | + {Credo.Check.Warning.UnusedTupleOperation}, |
| 87 | + {Credo.Check.Warning.OperationWithConstantResult}, |
| 88 | + ] |
| 89 | + } |
| 90 | + ] |
| 91 | +} |
0 commit comments