[−][src]Struct tokei::Config
A configuration struct for how Languages::get_statistics
searches and
counts languages.
use tokei::Config; let config = Config { treat_doc_strings_as_comments: Some(true), ..Config::default() };
Fields
columns: Option<usize>
Width of columns to be printed to the terminal. This option is ignored in the library. Default: Auto detected width of the terminal.
Count hidden files and directories. Default: false
.
no_ignore: Option<bool>
Don't respect ignore files. Default: false
.
no_ignore_parent: Option<bool>
Don't respect ignore files in parent directories. Default: false
.
no_ignore_vcs: Option<bool>
Don't respect VCS ignore files. Default: false
.
treat_doc_strings_as_comments: Option<bool>
Whether to treat doc strings in languages as comments. Default:
false
.
types: Option<Vec<LanguageType>>
Filters languages searched to just those provided. E.g. A directory
containing C
, Cpp
, and Rust
with a Config.types
of [Cpp, Rust]
will count only Cpp
and Rust
. Default: None
.
Methods
impl Config
[src]
pub fn from_config_files() -> Self
[src]
Creates a Config
from two configuration files if they are available.
Files can have two different names tokei.toml
and .tokeirc
.
Firstly it will attempt to find a config in the configuration directory
(see below), and secondly from the current directory. The current
directory's configuration will take priority over the configuration
directory.
Platform | Value | Example |
---|---|---|
Linux | $XDG_DATA_HOME or $HOME /.local/share | /home/alice/.local/share |
macOS | $HOME /Library/Application Support | /Users/Alice/Library/Application Support |
Windows | {FOLDERID_RoamingAppData} | C:\Users\Alice\AppData\Roaming |
Example
columns = 80
types = ["Python"]
treat_doc_strings_as_comments = true
Trait Implementations
impl Debug for Config
[src]
impl Default for Config
[src]
impl<'de> Deserialize<'de> for Config
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,