Closed DarthHater closed 4 years ago
@zendern let er rip. I had NEVER tested something that took stdin
input before, fun learning experiment doing so. Tests pass, and confirm that something is written to disk. I can think of one nice thing to do which is to not use /tmp
like I am and use ioutils.TempFile
, figured I'd see if you had any other ideas there though!
I believe I covered all the bases now. Parse tests now set ConfigLocation
to a nonsensical place so they won't test loading config from file. Previously if you'd set your config locally you'd get failing tests from it loading.
As well, I changed the logger to truncate the file by default now, which is effectively poor person log rotation. This was not specific to this task, but was easy and I figured I'd do it to make my own testing a bit easier.
I've tested the config for OSS Index and IQ Server myself locally, and everything checks out!
Last week much to my chagrin I discovered a few things:
This pull request makes the following changes:
set.go
topackage configuration
and wires up to it inmain.go
fornancy config
. Methods made public so thatcheque
andahab
can consume them easily as well~
and then.ossindex
or.iqserver
, and as.oss-index-config
or.iq-server-config
to be consistent with other tools out of the DevEx factory (set once, picked up by the other tools, great success)parse.go
, which we really should refactor at some point (there is so much duplication it's making me go ahhhhhhh, but not doing that in this PR quite yet)ossindex.go
so that I can pass in configuration a bit easier. Also decomposes some larger methods into smaller ones. Adds a new public function ofAuditPackageWithOSSIndex
, so that if someone is currently usingAuditPackages
upstream, they can still do that. Add's a deprecation notice toAuditPackages
with a note to use the new function instead.Couple lil fly by improvements:
LogLady
now truncates when it opens the log file, ensuring the log file is only ever for the most recent use ofnancy
, noticed this while helping on #107cc @bhamail / @DarthHater / @zendern / @fitzoh