Changelog
View Sourcev0.6.1
Bug Fixes
mix metacredoignored.metacredo.exs'sincludedscope by default: when neither--pathnor--files-includedwas given, the CLI task unconditionally defaulted analysis to the current directory ("."), silently overriding the configuredfiles.included(e.g.["lib/", "src/", "web/"]) and sweepingdeps/,_build/, and other non-source directories into the report.mix metacredo(andmix metacredo --diff, which shares the same option resolution) now correctly falls back to the config'sincludedpaths whenever--pathis omitted.excludedregex patterns silently failed to match relative paths without a leading path separator: the default (and generated)excludedpatterns (~r"/deps/",~r"/_build/",~r"/node_modules/",~r"/\.git/") required a literal/immediately before the directory name.Path.wildcard/1strips a leading"./"from a relativeincludedentry, so results like"deps/foo/lib/bar.ex"(no leading/) were never excluded even when correctly listed inexcluded. Patterns are now anchored with(^|/)so they match both relative ("deps/...") and nested/absolute (".../deps/...") paths. BothMetaCredo.Config.default/0andmix metacredo.gen.config's generated template are updated.
v0.6.0
Enhancements & Fine-Grained Tuning
Umbrella Switches (
no_dbandno_user):- Added CLI flags
--no-db/--no_dband--no-user/--no_usertomix metacredo. - Added support for
no_db: trueandno_user: true(as well asswitches: %{...}) in.metacredo.exs. --no-dbexcludes all database-related checks (NPlusOneQuery,SQLInjection,MissingPreload, and:dbtagged checks).--no-userexcludes all user input-related checks (ImproperInputValidation,XSSVulnerability,MissingCSRFProtection,PathTraversal,InsecureDirectObjectReference,UnrestrictedFileUpload,SSRFVulnerability,SensitiveDataExposure,InlineJavascript,MissingAuthentication,MissingAuthorization,IncorrectAuthorization,ParameterPatternMatching, and:user_input/:usertagged checks).
- Added CLI flags
Default-Off & Opt-In Checks:
- Hardcoded values in
.exsfiles:MetaCredo.Check.Security.HardcodedValuedefaultscheck_exs: false, skipping.exsscript/config files unless opted in withcheck_exs: true. - Module documentation in
.exsfiles:MetaCredo.Check.Readability.ModuleDocdefaultscheck_exs: false, skipping.exsscript/config files unless opted in withcheck_exs: true. - Return-value checks:
MetaCredo.Check.Warning.UnusedOperationandMetaCredo.Check.Warning.MissingErrorHandlingare disabled by default inConfig.default_disabled_checks/0and require explicit opt-in in.metacredo.exs.
- Hardcoded values in
Global User Configuration (
--globalflag):- Added
mix metacredo.gen.config --globalto write configuration to the user's global config directory (e.g.~/.config/metacredo/.metacredo.exsor$XDG_CONFIG_HOME/metacredo/.metacredo.exs). - Added automatic fallback to global configuration file in
MetaCredo.Config.read/1when no local configuration exists.
- Added
Bug Fixes
- ModuleDoc False-Positives: Resolved false-positive "Module has no documentation" warnings for Elixir modules using
@moduledoc "..."string attributes or@moduledoc false. Added AST assignment node inspection for@moduledocattributes.
v0.5.0
Enhancements & Maintenance
- Dependency Upgrade: Updated
:metastaticdependency constraint to~> 0.30. - Expanded Multi-Language Support: Integrated
MetaCredo.SourceswithMetastatic.Languagessingle source of truth for language detection and file extensions, adding support for Cure (.cure), March (.march,.mch), JavaScript (.js,.jsx,.mjs,.cjs), and TypeScript (.ts,.tsx). - Cure Adapter Comments & Directives: Configured Cure parser to preserve comments and enhanced inline directive handling (
# metacredo:disable-for-next-line) for.curesource files.
v0.4.3
- Code Quality: Applied system-wide code formatting and style improvements.
v0.4.2
- Encoding & Compatibility: Added robust Unicode/Latin1 handling for source files with non-standard character encodings.
v0.4.1
- Refactoring: Cleaned up internal helper functions and AST traversal routines.
v0.4.0
- Safety Enhancements: Improved AST metadata handling to prevent potential crashes on non-standard AST metadata forms.
v0.3.4
- Check Refactor: Rewrote
MetaCredo.Check.Observability.MissingTelemetryInObanWorkercheck to usecallback_forAST metadata for precise target method matching.
v0.3.3
- False Positive Reduction: Updated security checks (
HardcodedValue,SQLInjection, etc.) to skip literal strings found inside module and function documentation attributes (@moduledoc,@doc).
v0.3.2
- Defensive Traversal: Added fallback protections against unexpected or malformed AST node structures during check execution.
v0.3.1
- Documentation: HexDocs improvements and reference guide fixes.
v0.3.0
- Internal Analysis Engine: Replaced delegations to
Metastatic.Analysis.*with MetaCredo's own decoupled analysis engines:MetaCredo.Analysis.Complexity(Cognitive, Cyclomatic, Halstead, LoC, Nesting)MetaCredo.Analysis.DeadCodeMetaCredo.Analysis.Duplication(Fingerprinting & Similarity)MetaCredo.Analysis.Purity(Side-effect detection)
v0.2.0
- Diff-Based Analysis: Added
--diff,--base, and--headoptions to analyze only git-modified files in PRs and commits. - GitHub Actions Integration: Added
--format githubflag to produce GitHub Actions workflow commands and inline PR annotations (::error,::warning,::notice). - Git API: Introduced
MetaCredo.Gitmodule withchanged_files/2andrepo_root/1.
v0.1.1
- Configuration Generator: Added
mix metacredo.gen.configMix task to generate a customizable.metacredo.exsconfig file.
v0.1.0
Initial release.
Core Infrastructure
MetaCredo.Checkbehaviour macro mirroringCredo.Checkergonomics.MetaCredo.SourceFilewrappingMetastatic.Documentwith source text.MetaCredo.Issuestruct with priority/severity/exit status.MetaCredo.Configfor.metacredo.exsconfiguration parsing.MetaCredo.Executionpipeline: source discovery, check execution, inline disable filtering.MetaCredo.Sourcesfor multi-language file discovery and parsing.MetaCredo.CLI.Outputwith colored terminal output and JSON format.mix metacredotask with--strict,--only,--ignore,--format, andexplainsubcommand.mix metacredo.gen.configfor generating default configuration.- Inline disable comments via
# metacredo:disable-for-next-lineand# metacredo:disable-for-this-file.
Checks -- 72 total
Security (15): HardcodedValue, SQLInjection, XSSVulnerability, PathTraversal, SSRFVulnerability, SensitiveDataExposure, MissingCSRFProtection, InsecureDirectObjectReference, UnrestrictedFileUpload, TOCTOU, MissingAuthentication, MissingAuthorization, IncorrectAuthorization, ImproperInputValidation, InlineJavascript.
Warning (22): MissingErrorHandling, SilentErrorCase, SwallowingException, NPlusOneQuery, MissingPreload, UnmanagedTask, SyncOverAsync, MissingHandleAsync, DirectStructUpdate, CallbackHell, BlockingInPlug, MissingThrottle, InefficientFilter, ImperativeStatusHandling, UnusedOperation, UnsafeExec, BoolOperationOnSameValues, OperationOnSameValues, OperationWithConstantResult, LazyLogging, DebugLeftover, RaiseInsideRescue.
Readability (13): MagicNumber, DeepNesting, LongFunction, ComplexConditional, LongParameterList, FunctionNames, ModuleNames, VariableNames, ModuleDoc, SinglePipe, NestedFunctionCalls, Specs, LargeNumbers.
Refactor (10): SimplifyConditional, DeadCode, CodeDuplication, NegatedConditionWithElse, DoubleBooleanNegation, AppendSingleItem, PipeChainStart, FilterCount, UnlessWithElse, VariableRebinding.
Design (5): HighComplexity, LowCohesion, HighCoupling, TagTodo, TagFixme.
Observability (5): MissingTelemetryInObanWorker, MissingTelemetryInLiveviewMount, MissingTelemetryInAuthPlug, MissingTelemetryForExternalHttp, TelemetryInRecursiveFunction.