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()
};
columns: Option<usize>
Number columns to print. (Only used in the CLI).
Whether to treat doc strings in languages as comments. By default this
will be false
.
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
.
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 |
columns = 80
types = ["Python"]
treat_doc_strings_as_comments = true
Returns the "default value" for a type. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static