Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the Roc language #1154

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# Tokei ([時計](https://en.wiktionary.org/wiki/%E6%99%82%E8%A8%88))

[![Mean Bean CI](https://github.com/XAMPPRocky/tokei/workflows/Mean%20Bean%20CI/badge.svg)](https://github.com/XAMPPRocky/tokei/actions?query=workflow%3A%22Mean+Bean+CI%22)
[![Help Wanted](https://img.shields.io/github/issues/XAMPPRocky/tokei/help%20wanted?color=green)](https://github.com/XAMPPRocky/tokei/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
[![Lines Of Code](https://tokei.rs/b1/github/XAMPPRocky/tokei?category=code)](https://github.com/XAMPPRocky/tokei)
[![Documentation](https://docs.rs/tokei/badge.svg)](https://docs.rs/tokei/)
![](https://img.shields.io/crates/d/tokei?label=downloads%20%28crates.io%29)
![](https://img.shields.io/github/downloads/xampprocky/tokei/total?label=downloads%20%28GH%29)
![](https://img.shields.io/homebrew/installs/dy/tokei?color=brightgreen&label=downloads%20%28brew%29)
![Chocolatey Downloads](https://img.shields.io/chocolatey/dt/tokei?label=Downloads%20(Chocolately))
![Chocolatey Downloads](<https://img.shields.io/chocolatey/dt/tokei?label=Downloads%20(Chocolately)>)
[![dependency status](https://deps.rs/repo/github/XAMPPRocky/tokei/status.svg)](https://deps.rs/repo/github/XAMPPRocky/tokei)
[![Packaging status](https://repology.org/badge/tiny-repos/tokei.svg)](https://repology.org/project/tokei/versions)


Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code, comments, and blanks grouped by language.

### Translations

- [中文](https://github.com/chinanf-boy/tokei-zh#支持的语言)

## Example

```console
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Language Files Lines Code Comments Blanks
Expand Down Expand Up @@ -46,8 +48,8 @@ Tokei is a program that displays statistics about your code. Tokei will show the

- [Features](#features)
- [Installation](#installation)
- [Package Managers](#package-managers)
- [Manual](#manual)
- [Package Managers](#package-managers)
- [Manual](#manual)
- [Configuration](#configuration)
- [How to use Tokei](#how-to-use-tokei)
- [Options](#options)
Expand Down Expand Up @@ -89,6 +91,7 @@ Tokei is a program that displays statistics about your code. Tokei will show the
### Package Managers

#### Unix

```console
# Alpine Linux (since 3.13)
apk add tokei
Expand All @@ -113,6 +116,7 @@ sudo xbps-install tokei
```

#### macOS

```console
# Homebrew
brew install tokei
Expand All @@ -122,6 +126,7 @@ sudo port install tokei
```

#### Windows

```console
# Winget
winget install XAMPPRocky.tokei
Expand All @@ -132,18 +137,20 @@ scoop install tokei
### Manual

#### Downloading

You can download prebuilt binaries in the
[releases section](https://github.com/XAMPPRocky/tokei/releases).

#### Building

You can also build and install from source (requires the latest stable [Rust] compiler.)

```console
cargo install --git https://github.com/XAMPPRocky/tokei.git tokei
```

[rust]: https://www.rust-lang.org


## Configuration

Tokei has a [configuration] file that allows you to change default behaviour.
Expand All @@ -165,17 +172,20 @@ $ tokei ./foo
[configuration]: ./tokei.example.toml

#### Multiple folders

To have tokei report on multiple folders in the same call simply add a comma,
or a space followed by another path.

```shell
$ tokei ./foo ./bar ./baz
```

```shell
$ tokei ./foo, ./bar, ./baz
```

#### Excluding folders

Tokei will respect all `.gitignore` and `.ignore` files, and you can use
the `--exclude` option to exclude any additional files. The `--exclude` flag has
the same semantics as `.gitignore`.
Expand All @@ -188,6 +198,7 @@ Paths to exclude can also be listed in a `.tokeignore` file, using the same
[syntax](https://git-scm.com/docs/gitignore) as .gitignore files.

#### Sorting output

By default tokei sorts alphabetically by language name, however using `--sort`
tokei can also sort by any of the columns.

Expand All @@ -198,6 +209,7 @@ $ tokei ./foo --sort code
```

#### Outputting file statistics

By default tokei only outputs the total of the languages, and using `--files`
flag tokei can also output individual file statistics.

Expand All @@ -206,6 +218,7 @@ $ tokei ./foo --files
```

#### Outputting into different formats

Tokei normally outputs into a nice human readable format designed for terminals.
There is also using the `--output` option various other formats that are more
useful for bringing the data into another program.
Expand All @@ -225,6 +238,7 @@ tokei with the features flag.
```

**Currently supported formats**

- JSON `--output json`
- YAML `--output yaml`
- CBOR `--output cbor`
Expand All @@ -234,6 +248,7 @@ $ tokei ./foo --output json
```

#### Reading in stored formats

Tokei can also take in the outputted formats added in the previous results to its
current run. Tokei can take either a path to a file, the format passed in as a
value to the option, or from stdin.
Expand Down Expand Up @@ -280,6 +295,7 @@ ARGS:
```

## Badges

Tokei has support for badges. For example
[![](https://tokei.rs/b1/github/XAMPPRocky/tokei)](https://github.com/XAMPPRocky/tokei).

Expand All @@ -305,17 +321,21 @@ Example show total lines:
The server code hosted on tokei.rs is in [XAMPPRocky/tokei_rs](https://github.com/XAMPPRocky/tokei_rs)

## Dockerized version

Tokei is available in a small `alpine`-based docker image, buildable through [earthly](https://github.com/earthly/earthly):

```bash
earthly +docker
```

Once built, one can run the image with:

```bash
docker run --rm -v /path/to/analyze:/src tokei .
```

Or, to simply analyze the current folder (linux):

```bash
docker run --rm -v $(pwd):/src tokei .
```
Expand Down Expand Up @@ -373,7 +393,7 @@ CSharp
CShell
Css
Cuda
CUE
CUE
Cython
D
D2
Expand Down Expand Up @@ -506,6 +526,7 @@ Rakefile
Razor
Renpy
ReStructuredText
Roc
RON
RPMSpecfile
Ruby
Expand Down Expand Up @@ -578,6 +599,7 @@ Zsh
## Common issues

### Tokei says I have a lot of D code, but I know there is no D code!

This is likely due to `gcc` generating `.d` files. Until the D people decide on
a different file extension, you can always exclude `.d` files using the
`-e --exclude` flag like so
Expand All @@ -587,6 +609,7 @@ $ tokei . -e *.d
```

## Canonical Source

The canonical source of this repo is hosted on
[GitHub](https://github.com/XAMPPRocky/tokei). If you have a GitHub account,
please make your issues, and pull requests there.
Expand All @@ -597,6 +620,7 @@ please make your issues, and pull requests there.
interactive sunburst chart.

## Copyright and License

(C) Copyright 2015 by XAMPPRocky and contributors

See [the graph](https://github.com/XAMPPRocky/tokei/graphs/contributors) for a full list of contributors.
Expand Down
Loading