chore(deps): update dependency credo to v1.7.14 #94
+4
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.3.1->1.7.14Release Notes
rrrene/credo (credo)
v1.7.14Compare Source
DuplicatedCodeCredo.Check.Warning.ExpensiveEmptyEnumCheckto cover less obvious casesCredo.Check.Warning.StructFieldAmountv1.7.13Compare Source
Credo.Check.Refactor.ABCSizefixed false positivev1.7.12Compare Source
:columnon all checksCredo.Check.Refactor.DoubleBooleanNegationfixed false positiveCredo.Check.Readability.NestedFunctionCallsfixed false positiveCredo.Check.Consistency.UnusedVariableNamesfixed duplicate issuesv1.7.11Compare Source
:exit_statusand:categorytoformat_issue/2when usingCredo.CheckCredo.Check.Readability.ModuleDocfixed false positiveCredo.Check.Warning.UnusedEnumOperationfixed false positiveCredo.Check.Refactor.ABCSizefixed false positive for tuples and underscored matches (_foo)v1.7.10Compare Source
v1.7.9Compare Source
Credo.Check.Refactor.ABCSizefixed false positive for pin operator (^)Credo.Check.Readability.FunctionNamesfixed false positive for pow operator (**)Credo.Code.Parameterswhen couting parameters for functions with guardsv1.7.8Compare Source
Credo.Check.Refactor.Applyfixed false positiveCredo.Check.Warning.IoInspectfixed false positiveCredo.Check.Warning.UnsafeToAtomfixed false positiveCredo.Check.Readability.FunctionNamesfixed false positivev1.7.7Compare Source
Credo.Check.Design.SkipTestWithoutComment,Credo.Check.Refactor.PassAsyncInTestCasesandCredo.Check.Warning.WrongTestFileExtensionnow work for umbrella appsv1.7.6Compare Source
Credo.Check.Consistency.MultiAliasImportRequireUsefixed false positiveCredo.Check.Readability.PredicateFunctionNamesnow ignores functions that implement a behaviourCredo.Check.Readability.FunctionNamenow supports multi-letter sigilsCredo.Check.Readability.Specsfixed false positiveCredo.Check.Warning.UnusedKeywordOperationfixed false positivecolumninformation on several checks in case there are two offending calls on the same linev1.7.5Compare Source
--read-from-stdinnot respecting:files/:includedparamCredo.Check.Readability.NestedFunctionCallsno longer crashes for functions with an unquoted namev1.7.4Compare Source
Credo.Check.Refactor.UtcNowTruncateas opt-in check (this is scheduled to become a standard check in v1.8):triggerinCredo.Issueshort--read-from-stdinnot respecting:filesparamdiffcommand not recognizing a git ref as first argumentv1.7.3Compare Source
Credo.Check.Readability.AliasOrdernow supports a:sort_methodparameterCredo.Check.Readability.PredicateFunctionNamesreceived fixesCredo.Check.Warning.MissedMetadataKeyInLoggerConfigreceived fixesv1.7.2CHANGELOG.mdis now included in the packageCredo.Check.Readability.NestedFunctionCallsno longer warns on function calls in interpolated stringsCredo.Check.Readability.PredicateFunctionNamesfixed false positivesCredo.Check.Readability.RedundantBlankLinesfixed a bug with double quotes multiline stringsCredo.Check.Refactor.ModuleDependenciesnow takes modules for:excluded_namespacesparameterCredo.Check.Refactor.NegatedIsNilno longer leaks memoryCredo.Check.Warning.Dbgnow warns when part of a pipeline and called without parensCredo.Check.Warning.MissedMetadataKeyInLoggerConfigreceived various fixes and improvementsv1.7.1DuplicatedCodeCredo.Check.Warning.ExpensiveEmptyEnumCheckto cover less obvious casesCredo.Check.Warning.StructFieldAmountv1.7.0Compare Source
Credo.Check.Readability.ModuleDocworks for Phoenix 1.7+ viewsCredo.Check.Readability.FunctionNamesnow ignores custom operatorsCredo.Check.Refactor.Applynow works in pipesCredo.Check.Consistency.ExceptionNamesdoes no longer yield an issue if there is only one matchCredo.Check.Readability.ModuleNamesnow supports an:ignoreparameterCredo.Check.Design.AliasUsagenow supports an:if_referencedparameterCredo.Check.Readability.FunctionNamesnow works for acronyms in predicate functionsCredo.Check.Readability.NestedFunctionCallsnow works for calls already in a pipeline and local function callsAdd SARIF support
Credo 1.7 provides a formatter that will output data in SARIF format, allowing direct GitHub support via the
Securitytab.You can now use
mix credo --format=sarifto output results in SARIF format.Add IDs to checks
This was requested for SARIF support and has been added to provide a unique identifier for checks that is more technical than the check name.
Check authors can add IDs to their custom checks by using the
:idoption:...
Credo's naming scheme for these IDs is simple:
EXstands for Elixir.The first digit represents the category.
The second digit is always
0for Credo's standard checks (see below).The last two digits are the incremental number of the check.
This means that you can extend Credo with
all while adhering to Credo's own scheme (and of course, you can simply invent a completely different naming scheme for your checks).
Allow passing of multiple files to Mix task
It is now possible to pass a list of files to
mix credo.This means that you can now use the output of commands to determine which files to analyse, e.g.:
Ensure stable ordering of analysis results
Continuing our quest to remove ambiguity and reduce undocumented behaviour, Credo now orders its results by default.
Credo's results always had one caveat: Their order was determined by the runtime behaviour of the checks and workers running the checks (it was up to the output mechanism to provide its own stable order).
Now, results are always sorted by check ID, filename and line number.
New checks
Credo.Check.Readability.OneArityFunctionInPipeCredo.Check.Readability.OnePipePerLineCredo.Check.Refactor.FilterCountCredo.Check.Refactor.PassAsyncInTestCasesCredo.Check.Warning.MissedMetadataKeyInLoggerConfigv1.6.7Compare Source
v1.6.6Compare Source
Credo.Check.Readability.SpaceAroundOperatorsCredo.Check.Warning.UnusedStringOperationCredo.Code.Scope.mod_name/1v1.6.5Compare Source
Credo.Check.Readability.LargeNumbersmessageCredo.Check.Refactor.ApplyCredo.Check.Refactor.NegatedIsNilCredo.Check.Readability.WithSingleClausev1.6.4Compare Source
Credo.Check.Readability.MaxLineLengthCredo.Check.Refactor.PipeChainStartgen.checkcommandv1.6.3Compare Source
--debugnow includes slowest files, checks and file/check combinationsCredo.Check.Consistency.UnusedVariableNamesCredo.Check.Readability.SpaceAfterCommasCredo.Check.Warning.ForbiddenModuleCredo.Check.Warning.MixEnvCredo.Check.Readability.LargeNumbersnow supports:trailing_digitsv1.6.2Compare Source
-ias shorthand for--ignorev1.6.1Compare Source
v1.6.0Compare Source
Credo.Check.Readability.SinglePipenow supports:allow_0_arity_functionsCredo.Check.Design.AliasUsagenow supports:onlyFirst Run Mode
Credo 1.6 features a new mode, designed to be run every time you introduce Credo to an existing codebase.
This offers a couple of suggestions on how to introduce Credo to your workflow/CI.
All of these suggestions are contextualized and project-specific, here's an example when running it on Credo's codebase:
New Diff Options
mix credo diffis often used when developing on a branch and comparing that branch with a base branch.Let's illustrate this with the following example:
mix credo diff --from-git-ref master(same asmix credo diff master) - this will compare the current branch to the current state of the given ref (commitFin the example above)mix credo diff --from-git-merge-base master- this will compare the current branch to the point where the current branch was branched off of the given ref (commitBin the example above)There is also
--from-dirwhich you can use to compare the current dir to another dir, thus decoupling thediffcommand from Git, e.g.mix credo diff --from-dir ../credo_v1_5_6Pinning Checks in a Project's Config
Credo's config always had one caveat: Your configuration settings are merged with the default config, without you having any chance of knowing what the default config is (except by generating a fresh one via
mix credo.gen.config).this configures
LargeNumbersand all default checks are still enabledThis adds an additional problem: When checks are added to the default config, they are also added for you, because there is no way to explicitly say, which checks should run.
Credo 1.6 adds this option to explicitly say which checks are enabled on your project by changing the
:checkskey in the config from aListto aMapwith an:enabledkey:this means that only
LargeNumberswill run for this projectYou can now go the other way as well and disable checks explicitly while keeping their params instead of replacing them with
false:this means that
LargeNumbersis disabled for this projectThis has the added benefit that, when re-enabled via
--enable-disabled-checks, the check is enabled with its customized params.Credo configs are transitive in nature, so what about a situation where you want to pin checks for an umbrella, but overwrite individual checks in a child app? You can use the
:extraoption:my_umbrella/.credo.exs
my_umbrella/apps/my_app2/.credo.exs
this means that the checks config from the parent applies,
only
LargeNumbersbeing configured differently for this projectOf course, the "old" way of specifying a list of checks still works.
Exit Status
Before Credo 1.6 it was unclear which exit status "ranges" where intended for which kind of error.
For example, we are not enforcing the ranges for issue errors or plugin errors, but this change gives an official guideline to these considerations.
Working Directory
Up until now, Credo provided the ability to analyse files and directories anywhere on disk by simply typing
# BEFORE (now deprecated): mix credo ../other-elixir-project/This was not really documented and not really supported very well, resulting in most people not really utilizing it and instead running Credo from the root of their project using
mix credo.Now there is
--working-dir, which allows users to define their working directory explicitly:New checks
Credo.Check.Design.SkipTestWithoutCommentCredo.Check.Readability.PipeIntoAnonymousFunctionsCredo.Check.Readability.SingleFunctionToBlockPipeCredo.Check.Refactor.ApplyCredo.Check.Refactor.IoPutsCredo.Check.Refactor.MapJoinCredo.Check.Refactor.RedundantWithClauseResultv1.5.6Compare Source
v1.5.5Compare Source
mix credo diffwhere too many issues are reported becausev1.5.4Compare Source
:exit_statuswas not a valid option foruse Credo.Checkmix credo diffexited with a non-zero exit status even if no issues were shownmix credo diffnow fails with an error if the givenrefwas not foundv1.5.3Compare Source
diffandversioncommand whengitis not installedv1.5.2Compare Source
diffcommanddiffcommand when run on a Git ref that does not contain a given--config-name--config-nameis not foundCredo.Check.Warning.ExpensiveEmptyEnumCheckCredo.Check.Refactor.PipeChainStartregarding custom operators--versionto include pre version and build info for unpublished versions (e.g. when the dep is included viapath:orgithub:)v1.5.1Compare Source
diffcommand when run on a subdirectory of a Git repository:fileswhen excluding filesv1.5.0Compare Source
allow_acronymsto checkCredo.Check.Readability.FunctionNames--verbose.credo.exsOverwrite all tags for
FooCheckAdd tags for
FooCheckTags can then be used as usual, via the CLI switch
--checks-with[out]-tag:Only run checks tagged
:my_tagduring analysisExclude all checks tagged
:my_tagfrom analysisNew switch to enable file watcher
You can now ask Credo to re-run on file changes:
New
diffcommandYou can now ask Credo to only report changes in files that were changed since a given Git ref:
You can, of course, combine this with the new
--watchswitch to iteratively fix issues that have come up since the last release:New general check param
:filesYou can now include/exclude specific files or patterns for specific checks.
The syntax is the same as for the top-level
:fileskey:This means that you can now also include/exclude specific files or patterns for your custom checks by default.
The syntax is the same as with all other check params:
Please note that these params do not "override" the top-level config, but are applied to the result of the top-level config's resolution.
New checks
These new checks can now be enabled:
Credo.Check.Readability.BlockPipeCredo.Check.Readability.ImplTrueCredo.Check.Readability.SeparateAliasRequireAdditionally,
Credo.Check.Warning.ApplicationConfigInModuleAttributeis a new check which warns about reading environment variables into module attributes at compile-time and is enabled by default.v1.4.1Compare Source
v1.4.0Compare Source
Credo's schema for pre-release names changes: There is now a
.after therclike in many other Elixir projects.Add support for explaining checks (in addition to issues), i.e.
Add support for tags on checks
Checks can now declare tags via the
__using__macro, i.e.Tags can be used via the CLI switch
--checks-with[out]-tag:Only run checks tagged
:fooduring analysisExclude all checks tagged
:foofrom analysisAdd validation of check params in config
If a param is not found, Credo checks for mispellings and suggests corrections:
Add auto-generated check docs
Add new documentation on Hex with extra guides and CHANGELOG
v1.3.2Compare Source
Credo.Check.Readability.ParenthesesOnZeroArityDefsConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.