Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
Lint/UnusedGenericOrUnion
(#537)
* Add `Lint/UnusedPathGenericOrUnion` * UnusedPathGenericOrUnion -> UnusedTypeOrConstant * Split up specs for clarity * Rename `last_is_used` param for clarity, add documentation on ImplicitReturnVisitor * Remove unneeded visits from ImplicitReturnVisitor * UnusedTypeOrConstant -> UnusedGenericOrUnion * Update specs * Expand union check to include `self` * Update description * Check unions including typeof and underscores These are the only other nodes allowed in type unions (excluding "self?", as it can point to a method) * De-duplicate method in UnusedGenericOrUnion * Apply suggestions from code review Co-authored-by: Sijawusz Pur Rahnama <[email protected]> * @stack.positive? and formatting * Update unused_generic_or_union_spec.cr Co-authored-by: Sijawusz Pur Rahnama <[email protected]> * Update unused_generic_or_union_spec.cr Co-authored-by: Sijawusz Pur Rahnama <[email protected]> * Split up generic and union warning messages * Update src/ameba/rule/lint/unused_generic_or_union.cr Co-authored-by: Sijawusz Pur Rahnama <[email protected]> * Apply suggestions from code review Co-authored-by: Sijawusz Pur Rahnama <[email protected]> * Update src/ameba/rule/lint/unused_generic_or_union.cr Co-authored-by: Sijawusz Pur Rahnama <[email protected]> * Update src/ameba/rule/lint/unused_generic_or_union.cr Co-authored-by: Sijawusz Pur Rahnama <[email protected]> * Update unused_generic_or_union.cr Co-authored-by: Sijawusz Pur Rahnama <[email protected]> --------- Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
- Loading branch information