Findings
Every purrism lint prints its code as the scalafix lint id — [PreferEffectIdioms.manual-resource] — and appends a
one-sentence explanation to the message. This table (generated from FindingCatalog, also shipped in the jar as
purrism/findings.tsv) adds the repair instruction an agent harness shows next to the finding.
Under an umbrella rule the prefix is the umbrella's name ([TypelevelPurrism.readability-budget], not
[PreferArrow.readability-budget]), because the umbrella sums its children's patches; the same holds for
PreferTypeParameters and PreferCatsExpressions. Kinds are unique across the catalog, so join on the kind.
| code | title | explanation | instruction | doc |
|---|---|---|---|---|
PreferArrow.fan-out-shadowed-input |
Fan-out input shadowed in an inner scope | Both branches call .run/.apply with an argument spelled like the arrow's input, but the second resolves to a different binding, so under &&& the two Kleislis would no longer run on the same input. |
Rename the inner binding so it no longer shadows the arrow's input, or pass the input explicitly; then re-run <module>.fix. |
#preferarrow |
PreferArrow.readability-budget |
Kleisli body declined by the readability budget | The body could be written point-free, but the rendered composition would read worse than the hand-threaded original, so the rule declined. | Leave the body as it is, or split it into named Kleislis whose composition stays readable; re-run <module>.fix to see whether the rule now rewrites it. |
#preferarrow |
PreferArrow.unrecognised-body |
Kleisli body the parser did not recognise | The body has no monadic spine the Arrow parser understands, so no point-free form was attempted; this is reported only under PreferArrow.reportSkips. |
Compare the reported shape with the recognised entries in docs/ARROW_PATTERNS.md and restructure the body into a for/flatMap spine over the input, or leave it and turn reportSkips off. |
#preferarrow |
PreferCatsFunctions.ambiguous-cats-match |
Body matches more than one Cats function | The normalized body matches more than one public Cats function and ranking (public > in-scope > shortest) did not resolve a unique winner, so the rule did not rewrite. | Pick the Cats function you mean and call it directly, or narrow the body so only one matches; see docs/PREFERCATSFUNCTIONS.md §3-4 (D1), then compile. | #cats-expressions |
PreferCatsFunctions.missing-typeclass-evidence |
Cats match needs typeclass evidence not in scope | The matching Cats function requires a typeclass constraint that is not derivable from the enclosing parameter list, so the rewrite would not compile. | Add the required typeclass constraint (for example a context bound) to the enclosing definition and re-run <module>.fix; see docs/PREFERCATSFUNCTIONS.md §3 (D3). |
#cats-expressions |
PreferCatsFunctions.private-cats-match |
Body matches only a private Cats symbol | The body matches only a private or internal Cats implementation detail with no public API of the same normalized shape, and the rule never rewrites to a non-public symbol. | Keep the body, or express it through a public Cats function; see docs/PREFERCATSFUNCTIONS.md §3 (D2). | #cats-expressions |
PreferEffectIdioms.manual-resource |
Manual acquire/release in try/finally | A finally that closes a resource and does something else too cannot have the close lifted out mechanically, so the acquire/release stays invisible to the effect system. |
Reduce the finally to the close alone so Using.resource applies, or move the body into F and wrap it in Resource.make(acquire)(release); run <module>.fix again and compile. |
#prefereffectidioms |
PreferEffectIdioms.mutable-reference |
AtomicReference in effectful code | An AtomicReference threading state through an effectful body is a cats.effect.Ref in disguise, and rewriting it means lifting every use into F. |
Replace the AtomicReference with a Ref[F, A] created once in the resource scope and update it through Ref.update/modify; then compile. |
#prefereffectidioms |
PreferEffectIdioms.unsafe-cast |
Unchecked asInstanceOf | An asInstanceOf is a claim the compiler cannot check, so a wrong one fails at runtime instead of at compile time. |
Model the case in the type or pattern match on it, then compile to confirm the cast is gone. | #prefereffectidioms |
PreferOptionIdioms.throwing-lookup |
Lookup that throws on a missing key | getOrElse(key, throw ...) is a partial lookup wearing a total signature, so the caller cannot see that the key may be absent. |
Return Option from the lookup and let the caller decide what a missing key means; then compile and fix the call sites. |
#preferoptionidioms |
PreferPolymorphicCollections.container-not-abstract |
Container does not stay abstract | An operation on the container is not covered by the solved constraints, or its value is passed to a signature that names a concrete container, so the widened body would not compile. | Widen the receiving signature too, or replace the uncovered operation with one the constraint provides; then re-run <module>.fix. |
#polymorphic-signatures |
PreferPolymorphicCollections.explicit-type-arguments |
Container def called with explicit type arguments | A call site names this def's type arguments and inference cannot replace them, so the def cannot take another type parameter. | Let the call sites infer the type arguments, or leave the signature concrete; then re-run <module>.fix. |
#polymorphic-signatures |
PreferPolymorphicCollections.handed-over-as-value |
Container def handed over as a value | The def is referenced as a value rather than called, and a polymorphic method has no monomorphic function type, so widening it would stop that reference compiling. | Call the def at the use site instead of passing it as a value, or leave the signature concrete. | #polymorphic-signatures |
PreferPolymorphicCollections.name-conflict |
No free type parameter name | Every candidate name for the new type parameter (S, C, G) is already taken in the definition, so the rule has nothing to introduce. |
Rename one of the existing type parameters to free a candidate name, then re-run <module>.fix. |
#polymorphic-signatures |
PreferPolymorphicCollections.no-capability |
No Cats capability covers the container's use | No Cats typeclass in the index covers how the body uses the container, so there is no weaker signature to widen to. | Keep the concrete collection, or rewrite the body in terms of Foldable/Functor/Traverse operations and re-run <module>.fix. |
#polymorphic-signatures |
PreferPolymorphicCollections.order-or-index-specific |
Container used by position | The body reaches an element by position or order -- xs(i), .indices, .head, .sorted -- which expresses random access, and Cats has no typeclass for that. |
Express the body through Foldable/Traverse operations (foldLeft, get, traverse) or keep the concrete collection. |
#polymorphic-signatures |
PreferPolymorphicCollections.rewrite-off |
Container abstractable but rewriting is off | The container is abstractable over the reported constraints, but PreferPolymorphicCollections.rewrite = false leaves the signature unchanged. |
Widen the signature by hand to S[_] with the reported constraints, or set rewrite = true and re-run <module>.fix. |
#polymorphic-signatures |
PreferPolymorphicCollections.too-many-constraints |
Widening needs too many constraints | Widening the container needs more typeclass constraints than maxConstraints allows, so the signature would be busier than the concrete one. |
Raise PreferPolymorphicCollections.maxConstraints, or split the body so each def needs fewer capabilities; then re-run <module>.fix. |
#polymorphic-signatures |
PreferPolymorphicCollections.unsupported-kind |
Unsupported type-constructor kind | The container's type constructor has a kind the rule does not abstract over, such as the binary Map[K, V]. |
Keep the concrete type, or widen only the unary containers in the signature. | #polymorphic-signatures |
PreferPolymorphicTypeclasses.ambiguous-capability |
Operations with unrelated capability roots | The body uses operations whose Cats capabilities have unrelated roots, so no single weakest typeclass covers them. | Split the body so each def needs one capability family, or keep the concrete type. | #polymorphic-signatures |
PreferPolymorphicTypeclasses.concrete-constructor-match |
Pattern match on a concrete constructor | The body matches on the constructor's own cases, such as Nil or Some, which fixes the concrete type and cannot be expressed through a typeclass. |
Replace the match with a fold-style operation from the typeclass, or keep the concrete type. |
#polymorphic-signatures |
PreferPolymorphicTypeclasses.constructor-explicit-type-arguments |
Def called with explicit type arguments | A call site names this def's type arguments and inference cannot replace them, so the def cannot take another type parameter. | Let the call sites infer the type arguments, or leave the signature concrete; then re-run <module>.fix. |
#polymorphic-signatures |
PreferPolymorphicTypeclasses.constructor-handed-over-as-value |
Def handed over as a value | The def is referenced as a value rather than called, and a polymorphic method has no monomorphic function type, so widening it would stop that reference compiling. | Call the def at the use site instead of passing it as a value, or leave the signature concrete. | #polymorphic-signatures |
PreferPolymorphicTypeclasses.constructor-name-conflict |
No free type parameter name | Every candidate name for the new type parameter (G, H, K) is already taken in the definition, so the rule has nothing to introduce. |
Rename one of the existing type parameters to free a candidate name, then re-run <module>.fix. |
#polymorphic-signatures |
PreferPolymorphicTypeclasses.constructor-order-or-index-specific |
Constructor used by position | The body reaches an element by position or order -- xs(i), .indices, .head, .sorted -- which expresses random access, and Cats has no typeclass for that. |
Express the body through Foldable/Traverse operations (foldLeft, get, traverse) or keep the concrete type. |
#polymorphic-signatures |
PreferPolymorphicTypeclasses.constructor-rewrite-off |
Constructor abstractable but rewriting is off | The type constructor is abstractable over the reported constraints, but PreferPolymorphicTypeclasses.rewrite = false leaves the signature unchanged. |
Widen the signature by hand to G[_] with the reported constraints, or set rewrite = true and re-run <module>.fix. |
#polymorphic-signatures |
PreferPolymorphicTypeclasses.public-boundary |
Public API boundary kept concrete | The def is public and PreferPolymorphicTypeclasses.widenPublic = false, so its signature is a boundary the rule does not change. |
Make the def private, or set widenPublic = true if the call sites can absorb the new type parameter; then re-run <module>.fix. |
#polymorphic-signatures |
PreferPolymorphicTypeclasses.unsafe-body |
Body the widening cannot carry | The body throws, returns early, mutates a variable, or calls a method with no typeclass counterpart, so the constructor cannot be abstracted. | Remove the obstacle -- return a value instead of throwing or mutating, or replace the call -- and re-run <module>.fix. |
#polymorphic-signatures |
PropagateOpaqueType.merge-point |
Merge point outside the closure | A node the closure reached also receives a value the closure does not cover, so it keeps the underlying type and the call site unwraps. | Add the reported symbol to widen if that value belongs in the conversion too, otherwise leave the merge point unwrapped; then re-run <module>.fix. |
#propagateopaquetype |
PropagateOpaqueType.stale-semanticdb |
SemanticDB out of date | The SemanticDB payload for this file no longer matches the source on disk, so a closure computed from it would be wrong and the file was left unchanged. | Recompile to regenerate SemanticDB and re-run <module>.fix. |
#propagateopaquetype |
SuspendSideEffects.unsuspended-effect |
Side effect the signature does not mention | A method whose declared result is not an effect but whose body touches the world runs the effect when it is called, so nothing can sequence, retry or defer it. | Move the method to F[A] under Sync and wrap the body in Sync[F].delay, or mark a realtime path with // purrism:keep <reason>; then update the call sites and compile. |
#suspendsideeffects |
TypeclassWeakening.ambiguous-weakening |
Several weakest typeclasses fit the bound | The body needs less than the bound, but two or more typeclasses below it cover those needs and neither is weaker than the other, so the bound is kept rather than guessed or split. | Replace the bound by hand with the reported option that fits the def's callers, or keep it; then re-run <module>.fix. |
#typeclassweakening |