jnovinger

joined 2 years ago
MODERATOR OF
[–] jnovinger@programming.dev 2 points 2 years ago

Just coming back around on the count thing, in order to use wc -l, you need to ensure that stderr is piped too. Like:

deadcode . --exclude=*/tests,conftest.py --ignore-names-in-files=core/settings.py 2>&1 | wc -l

I ran this against a ~8 month old Django project and it turned up 11 unused names, of which 5 were expected and can be whitelisted. Nice!

[–] jnovinger@programming.dev 2 points 2 years ago* (last edited 2 years ago) (1 children)

I cross-posted to !devops@programming.dev too, hope you don't mind.

[–] jnovinger@programming.dev 3 points 2 years ago (5 children)

This is great! I really appreciate that it returns a sensible exit code to the shell so that it can potentially fail a build. I also like the ability to maintain a list of excluded names in pyrpoject.toml so that you don't always have to sort through false positives.

Would love to see some more output options, like maybe --quiet that simply passes/fails and returns the exit code with no output or --count that either just displays a count or includes a count in the regular output. I guess I could always pipe the output to wc -l instead of having --count.

I'll see if I can't get this integrated in our CI system at work this next week.

[–] jnovinger@programming.dev 2 points 2 years ago

Ha! Great catch. Yeah, I'll get that sorted.

[–] jnovinger@programming.dev 2 points 2 years ago

🤦‍♂️

Thank you

[–] jnovinger@programming.dev 0 points 2 years ago (4 children)

Still getting used to this. I'm having a hard time opening side-by-side terminals.

I think my next step is to reduce my config down to just this and make sure nothing is interfering. But if anybody already figured this out, I'm all ears.

[–] jnovinger@programming.dev 3 points 2 years ago (1 children)

Looks like @cubs_bot@fanaticus.social is working correctly!

[–] jnovinger@programming.dev 2 points 2 years ago

Also includes Tkinter and other forms of QT.

[–] jnovinger@programming.dev 2 points 2 years ago

It's alive!

I noticed an update from @subrehab@mastodon.social and went and looked.

[–] jnovinger@programming.dev 2 points 2 years ago

They talk about it in another post about the library.

[–] jnovinger@programming.dev 2 points 2 years ago

Also, a blog post from the new security developer-in-residence himself, Seth Larson, about the announcement.

view more: ‹ prev next ›