pub enum ToolArguments {
Files,
GoPackages,
Project,
}Expand description
What a tool is handed on its command line after its own flags.
Anything but ToolArguments::Files reports on more than the files being checked, so its findings are narrowed back to them. Without that a commit gate would block on pre-existing issues in code the commit never touched.
Variants§
Files
The files being checked.
GoPackages
The Go package directory each file being checked sits in, each once, as ./dir, after go list has said which of the files the build includes.
go vet checks a package, and a Go package is a directory. Handed files, it type-checks them as a package of their own: a diff touching one file of a multi-file package reported every symbol its siblings declare as undefined, and a diff spanning two directories failed with “named files must all be in one directory”. The ./ prefix is what makes go read the argument as a path rather than an import path.
A directory is all-or-nothing for the whole call, so go list -e -json runs first. A file build constraints exclude (//go:build tools, x_windows.go on a Mac) is reported in ToolOutcome::excluded and its directory is left out: go vet ./tools on a directory with no buildable file fails, and that failure aborts every other package in the call. A package that fails to load, an unresolvable import say, aborts the call the same way, so its load errors become the findings and vet does not run.
Project
Nothing: the tool checks its whole project.
cargo clippy checks a crate, and a path argument is rejected outright with “unexpected argument”. Appending files to it therefore made every run fail, so every Rust file came back Unavailable and drep check exited 2 on any Rust repository - the deterministic half for Rust never ran at all.
Trait Implementations§
Source§impl Clone for ToolArguments
impl Clone for ToolArguments
impl Copy for ToolArguments
Source§impl Debug for ToolArguments
impl Debug for ToolArguments
impl Eq for ToolArguments
Source§impl PartialEq for ToolArguments
impl PartialEq for ToolArguments
impl StructuralPartialEq for ToolArguments
Auto Trait Implementations§
impl Forget for ToolArguments
impl Freeze for ToolArguments
impl Move for ToolArguments
impl RefUnwindSafe for ToolArguments
impl Send for ToolArguments
impl Sync for ToolArguments
impl Unpin for ToolArguments
impl UnsafeUnpin for ToolArguments
impl UnwindSafe for ToolArguments
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.