Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this project limited to Rails/Phoenix code? #50

Open
mausch opened this issue Dec 4, 2022 · 1 comment
Open

Is this project limited to Rails/Phoenix code? #50

mausch opened this issue Dec 4, 2022 · 1 comment

Comments

@mausch
Copy link

mausch commented Dec 4, 2022

Hi, this project looks very interesting! Just wondering if it's only meant to work on Rails/Phoenix code?
I generated tags using universal-ctags on C# and Python projects but unused doesn't seem to find any unused code (there's obvious unused code that I introduced on purpose to test this).

Maybe I'm misunderstanding what "unused code" means in the context of this tool?

For example given this Python code:

xx=1
print("Hello World")

I get this output from nix shell nixpkgs#universal-ctags nixpkgs#unused -c sh -c "ctags -R; unused":

== UNUSED SUMMARY ==
   Tokens found: 0
   Files found: 0
   Applied language filters: except Markdown, JSON
   Sort order: token (asc)
   Usage likelihood: high
   Configuration setting: Default

I was expecting it to find xx=1 as unused code.

$ nix shell nixpkgs#universal-ctags nixpkgs#unused -c sh -c "unused doctor"
Unused Doctor

[OK] Check: Is the tags file not present in the list of files searched?
     The tags file loaded ("/home/mauricio/prg/unused-python-test/tags") is not present in the list of files searched
[Warning] Check: Are tokens found in the application?
     1 token(s) found
[OK] Check: Are files found in the application?
     2 file(s) found
[OK] Check: Is the tags file generated with Universal Ctags?
     Using tags program: Universal Ctags (Derived from Exuberant Ctags)
[OK] Check: Does the loaded configuration have available project types?
     Loaded the following project configurations: Rails, Phoenix

Outcome: 4 OK, 1 warnings, 0 errors
@joshuaclayton
Copy link
Member

Hi @mausch !

It's not just geared towards Ruby and Elixir codebases, no.

unused doctor is hinting at a warning around the number of tags unused is finding (just 1) - it looks like Ctags may not be picking up tags. Can you check the tags file unused is finding and see if you can generate more tags?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants