Language
This section contains the reference for the implementation of tokei's Language
struct.
Language ¶
A struct representing statistics about a single Language.
References¶
Examples¶
Note
mark_inaccurate
is not defined, this may be better done from the rust side.
add_report ¶
Add a Report
to the Language.
This will not update the totals in the Language
class.
children
property
¶
A map of any languages found in the reports. tokei reference.
children_plain ¶
The equivalent version of reports_plain
method, but with children.
comments
property
¶
The total number of comments(both single, and multi-line). tokei reference.
innacurate
property
¶
Whether this language had problems with file parsing. tokei reference.
is_empty ¶
Checks if the language is empty. Empty meaning it doesn't have any statistics.
reports
property
¶
A collection of statistics of individual files. tokei reference.
reports_plain ¶
A version of reports
method but in plain python objects.
Instead of a list with reports, it returns a list with dicts containing as key the name of the file and a dict with each one of the reports's objects.
sort_by ¶
Sorts each of the Report
s contained in the language based on what category is provided.
summarise ¶
Creates a new Language
from self
, which is a summarised version
of the language that doesn't contain any children.
It will count non-blank lines in child languages as code unless the child
language is considered "literate" then it will be counted as comments.
total ¶
Totals up the statistics of the Stat
class currently contained in the language.