Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Find unused functions in your project

License

NotificationsYou must be signed in to change notification settings

hauleth/mix_unused

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Module VersionHex DocsTotal DownloadLicenseLast UpdatedCodeCov

Mix compiler tracer for detecting unused public functions.

Installation

defdepsdo[{:mix_unused,"~> 0.3.0"}]end

The docs can be found athttps://hexdocs.pm/mix_unused.

Usage

After installation you need to add:unused as a compiler to the list of Mixcompilers:

defmoduleMySystem.MixProjectdouseMix.Projectdefprojectdo[compilers:[:unused]++Mix.compilers(),# In case of Phoenix projects you need to add it to the list# compilers: [:unused, :phoenix, :gettext] ++ Mix.compilers()# ...## If you want to only run it in the dev environment you could do# it by using `compilers: compilers(Mix.env()) ++ Mix.compilers()`# instead and then returning the right compilers per environment.]end# ...end

Then you just need to runmix compile ormix compile --force as usualand unused hints will be added to the end of the output.

Warning

This isn't perfect solution and this will not find dynamic calls in form of:

apply(mod,func,args)

So this mean that, for example, if you have customchild_spec/1 definitionthenmix unused can return such function as unused even when you are usingthat indirectly in your supervisor.

Configuration

You can define used functions by addingmfa inunused: [ignored: [⋯]]in your project configuration:

defprojectdo[# ⋯unused:[ignore:[{MyApp.Foo,:child_spec,1}]],# ⋯]end

Copyright and License

Copyright © 2021 by Łukasz Niemier

This work is free. You can redistribute it and/or modify it under theterms of the MIT License. See theLICENSE file for more details.


[8]ページ先頭

©2009-2025 Movatter.jp