Changelog
View Sourcev0.7.1
Jump.CredoChecks.UndeclaredExternalResourceno longer flags typespec attributes (@type,@spec,@callback, etc.) that mentionFiletypes likeFile.posix(), since typespecs are never evaluated and so can't read from the file system.
v0.7.0
- Added
Jump.CredoChecks.NoWordSigilInterpolation, which flags interpolation inside lowercase word sigils (~w). The sigil splits on whitespace after interpolation, so quoting a phrase doesn't keep it together and interpolated values can unexpectedly become multiple list items. Use an explicit list instead. Jump.CredoChecks.LiveViewFormCanBeRehydratedno longer crashes onembed_templatescalls with options (e.g.embed_templates "templates/*", suffix: "_html") (#51).Jump.CredoChecks.TestHasNoAssertionsnow counts calls to functions defined in the test file whose bodies assert, so tests built from helpers likethen_it_shows(...)are no longer flagged.- Fixed two oversights in
Jump.CredoChecks.DoctestIExExamples(cases we failed to catchiex>examples that never got doctested):- Examples in a nested module; each module with examples now needs its own
doctest, sincedoctest MyApp.Outerdoesn't run the examples inMyApp.Outer.Inner. - Fixed edge cases in how we parsed module names, so that we now resolve aliases (including
alias ..., as: ...) correctly, and we do not treat commented-out doctest lines as passing.
- Examples in a nested module; each module with examples now needs its own
v0.6.0
Added
Jump.CredoChecks.AvoidModifyingStructBeforeChangeset, which flags structs that are modified (via%{struct | field: value},Map.put/3,struct/2, a local helper function, etc.) before being passed into a changeset function. Values set this way aren't tracked as changes, so they bypass all changeset validation, and an update silently won't save them.- Two big improvements to
Jump.CredoChecks.UseObanProWorker:- Flag
process/1callbacks that expect string keys in the job args when the worker declares anargs_schema. (Theargs_schemaensures the worker will only ever be called with atom keys in the args.) - Add
supported_worker_modules(default:[Oban.Pro.Worker]) so project-specific wrappers can be treated as equivalent touse Oban.Pro.Worker.
- Flag
Jump.CredoChecks.UndeclaredExternalResourceno longer treats an aliased module bound to the nameFile(alias MyApp.Files.File) as Elixir'sFile, soFile.t()in a@specno longer reports a missing@external_resource(#38).- Fixed a bug in
Jump.CredoChecks.VacuousTestaroundas:aliases (#42) - Improvements to
Jump.CredoChecks.AssertReceiveTimeout:- It now resolves a timeout held in a module attribute (
@timeout 5_000) when the attribute is assigned once with an integer literal, instead of flagging it as unverifiable (#37). - Its
max_refute_receive_timeoutnow also flags PhoenixTestrefute_hascalls that pass an explicit:timeoutlonger than the configured maximum.
- It now resolves a timeout held in a module attribute (
v0.5.0
- Added
Jump.CredoChecks.NoManualContentDispositioncheck, courtesy of @ftes (PR. - Added
Jump.CredoChecks.LiveViewPubSubRequiresConnected, which flagsPhoenix.PubSub.subscribe/{2,3}calls (or your custom wrappers) in LiveViewmount/3that are not wrapped inif connected?(socket). (PR) - Improvements to
Jump.CredoChecks.UnusedLiveViewAssign:
v0.4.0
Added 4 new checks:
Jump.CredoChecks.AssertReceiveTimeout, which flagsassert_receivecalls that specify an explicit timeout. Supports an optionalmin_assert_receive_timeoutparameter that allows literalassert_receivetimeouts greater than or equal to the configured minimum, and an optionalmax_refute_receive_timeoutparameter that flagsrefute_receivecalls whose timeout exceeds the configured maximum. (PR)Jump.CredoChecks.ConditionalAssertion, which flags assertions that include an "or." Tests should be able to confidently assert which branch will be taken every time. (PR)Jump.CredoChecks.UndeclaredExternalResource, which flags module attributes that read from the file system at compile time (e.g.,File.read!/1) without declaring an@external_resource. Without it, editing the file won't trigger a recompile, leaving stale data baked into the module. (PR)Jump.CredoChecks.SafeBinaryToTerm, which flagsPlug.Crypto.non_executable_binary_to_term/2calls that omit the:safeoption. Decoding attacker-controlled input without:safeinterns arbitrary atoms and can exhaust the atom table, crashing the node. (PR courtesy of first-time contributor @peaceful-james)
Dependency updates:
- Igniter 0.8.0 -> 0.8.1
- Credo 1.7.18 -> 1.7.19
v0.3.0
- New check: Add
Jump.CredoChecks.UnusedLiveViewAssign, compliments of first-time contributor @ftes (PR) - Fix for
Jump.CredoChecks.LiveViewFormCanBeRehydrated: Don't warn about missingphx-changeon forms withphx-auto-recover="ignore"(PR) - Dependency updates:
- Bump ex_doc from 0.40.1 to 0.40.3 (PR 1, PR 2)
- Bump igniter from 0.7.9 to 0.8.0
- Bump quokka from 2.12.1 to 2.13.1
v0.2.0
- Add Igniter task to support installing via
mix igniter.install jump_credo_checks, courtesy of @britton-jb. - Add new
Jump.CredoChecks.PreferChangeOverUpDownMigrationscheck, which detects Ecto migrations that define separateup/downcallbacks but could instead take advantage of Ecto's automatic reversibility by usingchange/0.
v0.1.0
Initial release.