pub struct SourceOptions {
pub extensions: Vec<String>,
pub repo_root: String,
pub lines_changed_only: LinesChangedOnly,
pub files_changed_only: bool,
pub ignore: Vec<String>,
pub diff_base: Option<String>,
pub ignore_index: bool,
}Expand description
A struct to describe the CLI’s source options.
Fields§
§extensions: Vec<String>A comma-separated list of file extensions to analyze.
repo_root: StringThe relative path to the repository root directory.
This path is relative to the runner’s GITHUB_WORKSPACE
environment variable (or the current working directory if
not using a CI runner).
lines_changed_only: LinesChangedOnlyThis controls what part of the files are analyzed.
files_changed_only: boolSet this option to false to analyze any source files in the repo.
This is automatically enabled if
--lines-changed-only is enabled.
[!NOTE] The
GITHUB_TOKENshould be supplied when running on a private repository with this option enabled, otherwise the runner does not not have the privilege to list the changed files for an event.
ignore: Vec<String>Set this option with path(s) to ignore (or not ignore).
- In the case of multiple paths, you can use
|to separate each path. - There is no need to use
./for each entry; a blank string ('') represents the repo-root path. - This can also have files, but the file’s path (relative to
the
--repo-root) has to be specified with the filename. - Submodules are automatically ignored. Hidden directories (beginning
with a
.) are also ignored automatically. - Prefix a path with
!to explicitly not ignore it. This can be applied to a submodule’s path (if desired) but not hidden directories. - Glob patterns are supported here. Path separators in glob patterns should
use
/because\represents an escaped literal.
diff_base: Option<String>The git reference to use as the base for diffing changed files.
This can be any valid git ref, such as a branch name, tag name, or commit SHA. If it is an integer, then it is treated as the number of parent commits from HEAD.
This option only applies to non-CI contexts (eg. local CLI use).
ignore_index: boolAssert this switch to ignore any staged changes when
generating a diff of changed files.
Useful when used with --diff-base.
Trait Implementations§
Source§impl Clone for SourceOptions
impl Clone for SourceOptions
Source§fn clone(&self) -> SourceOptions
fn clone(&self) -> SourceOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more