Releases: elixir-vibe/ex_slop
Releases · elixir-vibe/ex_slop
v0.4.2
v0.4.1
- Plugin system — ExSlop now uses
register_default_configwithchecks.extra, matching the Credo ecosystem convention (AshCredo, credo_contrib, etc.). Setup is justplugins: [{ExSlop, []}]in.credo.exs. - RescueWithoutReraise fix — no longer fires when the rescued exception binding appears in the return value (e.g.
{:error, {:reason, error}}). Also handlese in ExceptionTypepatterns andunquoteedge cases.
v0.4.0
Added
- Added
ExSloprecommended bundle — configure{ExSlop, :recommended}to enable the curated high-signal check set. - Added
ExSlop.recommended_checks/0for tools that want the same curated check list programmatically. - Added
RedundantEnumJoinSeparator(EXS4016) — flagsEnum.join(parts, ""); useEnum.join(parts)instead. - Added
UseMapJoin(EXS4017) — flagsEnum.map/2 |> Enum.join/1; useEnum.map_join/3instead. Opt-in only. - Added
PreferEnumSlice(EXS4018) — flagsEnum.drop/2 |> Enum.take/2; useEnum.slice/3instead. Opt-in only. - Added
GraphemesLength(EXS4019) — flags countingString.graphemes/1; useString.length/1instead. - Added
ManualStringReverse(EXS4020) — flagsString.graphemes/1 |> Enum.reverse/1 |> Enum.join/1; useString.reverse/1instead. - Added
SortThenAt(EXS4021) — flagsEnum.sort/1 |> Enum.at/2when a single-pass selection is likely clearer. - Added
SortForTopK(EXS4022) — flagsEnum.sort/1 |> Enum.take(1)andEnum.sort/1 |> hd/1; use min/max or single-pass selection instead. - Added
ListFold(EXS4023) — flagsList.foldl/3andList.foldr/3; useEnum.reduce/3instead. Opt-in only. - Added
ListLast(EXS4024) — flagsList.last/1because it traverses the whole list. Opt-in only. - Added
LengthInGuard(EXS4025) — flagslength/1in guards; prefer pattern matching where possible. Opt-in only. - Added
ExplicitSumReduce(EXS4026) — flags manual summing withEnum.reduce/3; useEnum.sum/1instead.
Changed
- The recommended bundle now excludes checks that proved noisy on mature Elixir codebases, while keeping them available for explicit opt-in.
- Updated documentation with the recommended bundle and full check list.
v0.3.1
What's Changed
New checks
PathExpandPriv(EXS1006) — flagsPath.expand("...priv...", __DIR__)for app resources; useApplication.app_dir/2instead.DualKeyAccess(EXS1007) — flags mixed atom/string key access; normalize data once at the boundary.ReduceMapPut(EXS4013) — flagsEnum.reduce(%{}, fn x, acc -> Map.put(acc, key, value) end); useMap.new/2.RedundantBooleanIf(EXS4014) — flagsif condition, do: true, else: false; use the condition directly.FlatMapFilter(EXS4015) — flagsEnum.flat_map(fn x -> if condition, do: [x], else: [] end); useEnum.filter/2.
Fixes
- Expanded
DualKeyAccessdetection to catch mixed access acrossMap.get,Map.fetch,Map.fetch!,get_in, access syntax, and chained||expressions. - Fixed
BlanketRescuefalse positives for specific exception rescues.
Published to Hex as ex_slop 0.3.1.
v0.3.0
What's Changed
New check
UnaliasedModuleUse(EXS3009) — flags when a fully-qualified module name is used 3+ times within a single function body without analias. Configurablemin_count. Unlike Credo'sAliasUsage, no stdlib exclusions — catches the dense FQN repetition that LLMs produce.
Fixes
- Fixed all dialyzer warnings by replacing
~r//regex literals with string operations orRegex.compile!. - Added missing
aliasdeclarations in existing checks.