Skip to content

Releases: elixir-vibe/ex_slop

v0.4.2

25 May 10:27

Choose a tag to compare

Added

  • Added LengthComparison (EXS4027) to flag length/1 comparisons against integer literals in any context.

v0.4.1

14 May 09:06

Choose a tag to compare

  • Plugin system — ExSlop now uses register_default_config with checks.extra, matching the Credo ecosystem convention (AshCredo, credo_contrib, etc.). Setup is just plugins: [{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 handles e in ExceptionType patterns and unquote edge cases.

v0.4.0

01 May 14:39

Choose a tag to compare

Added

  • Added ExSlop recommended bundle — configure {ExSlop, :recommended} to enable the curated high-signal check set.
  • Added ExSlop.recommended_checks/0 for tools that want the same curated check list programmatically.
  • Added RedundantEnumJoinSeparator (EXS4016) — flags Enum.join(parts, ""); use Enum.join(parts) instead.
  • Added UseMapJoin (EXS4017) — flags Enum.map/2 |> Enum.join/1; use Enum.map_join/3 instead. Opt-in only.
  • Added PreferEnumSlice (EXS4018) — flags Enum.drop/2 |> Enum.take/2; use Enum.slice/3 instead. Opt-in only.
  • Added GraphemesLength (EXS4019) — flags counting String.graphemes/1; use String.length/1 instead.
  • Added ManualStringReverse (EXS4020) — flags String.graphemes/1 |> Enum.reverse/1 |> Enum.join/1; use String.reverse/1 instead.
  • Added SortThenAt (EXS4021) — flags Enum.sort/1 |> Enum.at/2 when a single-pass selection is likely clearer.
  • Added SortForTopK (EXS4022) — flags Enum.sort/1 |> Enum.take(1) and Enum.sort/1 |> hd/1; use min/max or single-pass selection instead.
  • Added ListFold (EXS4023) — flags List.foldl/3 and List.foldr/3; use Enum.reduce/3 instead. Opt-in only.
  • Added ListLast (EXS4024) — flags List.last/1 because it traverses the whole list. Opt-in only.
  • Added LengthInGuard (EXS4025) — flags length/1 in guards; prefer pattern matching where possible. Opt-in only.
  • Added ExplicitSumReduce (EXS4026) — flags manual summing with Enum.reduce/3; use Enum.sum/1 instead.

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

26 Apr 07:40

Choose a tag to compare

What's Changed

New checks

  • PathExpandPriv (EXS1006) — flags Path.expand("...priv...", __DIR__) for app resources; use Application.app_dir/2 instead.
  • DualKeyAccess (EXS1007) — flags mixed atom/string key access; normalize data once at the boundary.
  • ReduceMapPut (EXS4013) — flags Enum.reduce(%{}, fn x, acc -> Map.put(acc, key, value) end); use Map.new/2.
  • RedundantBooleanIf (EXS4014) — flags if condition, do: true, else: false; use the condition directly.
  • FlatMapFilter (EXS4015) — flags Enum.flat_map(fn x -> if condition, do: [x], else: [] end); use Enum.filter/2.

Fixes

  • Expanded DualKeyAccess detection to catch mixed access across Map.get, Map.fetch, Map.fetch!, get_in, access syntax, and chained || expressions.
  • Fixed BlanketRescue false positives for specific exception rescues.

Published to Hex as ex_slop 0.3.1.

v0.3.0

22 Apr 18:38

Choose a tag to compare

What's Changed

New check

  • UnaliasedModuleUse (EXS3009) — flags when a fully-qualified module name is used 3+ times within a single function body without an alias. Configurable min_count. Unlike Credo's AliasUsage, no stdlib exclusions — catches the dense FQN repetition that LLMs produce.

Fixes

  • Fixed all dialyzer warnings by replacing ~r// regex literals with string operations or Regex.compile!.
  • Added missing alias declarations in existing checks.

Contributors

  • feat (ObviousComment): Support additional keyword triggers by @s3cur3 in #1