├── .gitignore ├── resources ├── cpython.csv ├── rust.csv ├── redis.csv ├── unreal-engine.csv ├── benchmark.plot ├── redis.svg ├── unreal-engine.svg ├── cpython-with-cloc.svg ├── rust.svg ├── cpython.svg ├── redis-with-cloc.svg ├── rust-with-cloc.svg └── unreal-engine-with-cloc.svg ├── LICENCE-APACHE ├── LICENCE-MIT ├── CONTRIBUTING.zh.md ├── CONTRIBUTING.md ├── readme.md ├── en.md ├── languages.json └── COMPARISON.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .DS_Store 3 | fork 4 | source -------------------------------------------------------------------------------- /resources/cpython.csv: -------------------------------------------------------------------------------- 1 | command,mean 2 | tokei,162.616040335 3 | scc,349.010611535 4 | loc,100.77284752854836 5 | # cloc,3.889367681835 6 | -------------------------------------------------------------------------------- /resources/rust.csv: -------------------------------------------------------------------------------- 1 | command,mean 2 | tokei,254.6492735777273 3 | scc,298.576616605 4 | loc,239.7174873819231 5 | # cloc,6.873934700605 6 | -------------------------------------------------------------------------------- /resources/redis.csv: -------------------------------------------------------------------------------- 1 | command,mean 2 | tokei,32.65851210948718 3 | scc,50.464578491403525 4 | loc,29.36477992999999 5 | # cloc,1.28835733323 6 | -------------------------------------------------------------------------------- /resources/unreal-engine.csv: -------------------------------------------------------------------------------- 1 | command,mean 2 | tokei,2.7053018181799997 3 | scc,5.308592593179999 4 | loc,2.35001430618 5 | # cloc,72.38989142927998 6 | -------------------------------------------------------------------------------- /resources/benchmark.plot: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env gnuplot -c 2 | 3 | if (strlen(ARG1) == 0) print "Usage: " . ARG0 . " "; exit 4 | 5 | set terminal svg 6 | set datafile separator comma 7 | set title "Performance on the " . ARG1 . " Repository w/o Cloc (Lower is better)" 8 | unset key 9 | set xlabel 'Program' 10 | set ylabel 'Mean time (milliseconds)' 11 | # Adjust depending on graphs. 12 | set yrange [0:380] 13 | set style fill solid 14 | set style data histogram 15 | set xtics center 16 | plot ARG2 using 2:xtic(1) title columnheader 17 | -------------------------------------------------------------------------------- /LICENCE-APACHE: -------------------------------------------------------------------------------- 1 | Copyright 2016 Aaron Power 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /LICENCE-MIT: -------------------------------------------------------------------------------- 1 | MIT License (MIT) 2 | 3 | Copyright (c) 2016 Aaron Power 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /CONTRIBUTING.zh.md: -------------------------------------------------------------------------------- 1 | 2 | # 为Tokei做贡献 3 | 4 | - [语言增加](#language-addition) 5 | - [错误报告](#bug-reports) 6 | 7 | # 语言增加 8 | 9 | 目前tokei从[`languages.json`](languages.json)文件中生成语言. JSON使,添加新语言变得容易,并且在不改变大数据结构的情况下改变代码结构. 在这里,我们将介绍一种语言的属性`languages.json`通过例子. 10 | 11 | "JavaScript":{ 12 | "base":"c", 13 | "quotes":[ 14 | [ 15 | "\\\"", 16 | "\\\"" 17 | ], 18 | [ 19 | "'", 20 | "'" 21 | ], 22 | [ 23 | "`", 24 | "`" 25 | ] 26 | ], 27 | "extensions":[ 28 | "js" 29 | ] 30 | }, 31 | 32 | 以上是JavaScript的定义. 需要定义的第一件事是密钥,密钥格式应该是相同的[rust's enum style]]. 因为此密钥将在枚举中用于识别语言. 对于很多语言来说,这也适用于在我们打印到屏幕时显示语言. 但是,有些语言的名称不适用于枚举样式. 例如`JSON`通常以全部大写字母显示,但这不符合Rust的枚举风格. 所以我们有一个名为`name`的附加可选字段,它定义了语言在向用户显示时的外观. 33 | 34 | ```json 35 | "Json" { 36 | "name": "JSON", 37 | ``` 38 | 39 | 对于定义注释有一些属性: 首先是最常用的`single`定义单行注释的属性. 注释不会继续下一行. 40 | 41 | ```rust 42 | let x = 5; // default x position 43 | let y = 0; // default y position 44 | ``` 45 | 46 | 该`single`属性需要一个字符串数组,因为某些语言有多种语法来定义单行注释. 例如`PHP`允许两者`#`和`//`作为注释. 47 | 48 | ```json 49 | "Php": { 50 | "single": [ 51 | "#", 52 | "//" 53 | ] 54 | ``` 55 | 56 | 为了定义也有结尾语法的注释,有`multi_line`属性. 57 | 58 | ```rust 59 | let x = /* There is a reason 60 | for this comment I swear */ 61 | 10; 62 | ``` 63 | 64 | 许多语言具有相同的注释语法,通常继承自作者以前的语言或首选语言. 为了避免代码重用,tokei的语言有了`base`表示使用通用注释语法的属性. 例如 65 | 66 | ```json 67 | "ActionScript":{ 68 | "base":"c", 69 | "extensions":[ 70 | "as" 71 | ] 72 | } 73 | ``` 74 | 75 | #### bases 76 | 77 | - `blank`一种没有注释的语言. 78 | - `c`单: `//`,多行: `/* */`,行情: `" "` 79 | - `func`多行: `(* *)`,行情: `" "` 80 | - `html`多行: ``,行情: `" "` 81 | - `hash`单: `#` 82 | - `haskell`单: `--`,多行: `{- -}`,嵌套: `true` 83 | - `pro`单: `%`,多行: `/* */`,行情: `" "` 84 | 85 | 有些语言有一个标准的文件名,没有扩展名,像`Makefile`要么`Dockerfile`. 这些可以用`filenames`属性: 86 | 87 | ```json 88 | "Makefile":{ 89 | "filenames":[ 90 | "makefile" 91 | ], 92 | "extensions":[ 93 | "makefile", 94 | "mak", 95 | "mk" 96 | ] 97 | } 98 | ``` 99 | 100 | 无论文件名是否包含大写字母,文件名都应为全小写. 101 | 102 | 请注意,文件名将会被定义的扩展名为`CMakeLists.txt`**覆盖**,将被检测为`CMake`文件,而不是`Text`文件. 103 | 104 | ```json 105 | "Text":{ 106 | "extensions":[ 107 | "txt" 108 | ] 109 | }, 110 | "CMake":{ 111 | "filenames": [ 112 | "cmakelists.txt" 113 | ] 114 | } 115 | ``` 116 | 117 | # 测试 118 | 119 | 添加语言时需要测试文件. 该文件应包含每个变体注释和引号,以及文件顶部的注释,其中包含手动验证的行,代码,注释,空格,例如`// 39 lines 32 code 2 comments 5 blanks`. 注释应该使用您正在测试的语言的语法. 测试文件的一个很好的例子是[`tests/data/rust.rs`]. 120 | 121 | ```rust 122 | // 39 lines 32 code 2 comments 5 blanks 123 | 124 | /* /**/ */ 125 | fn main() { 126 | let start = "/*"; 127 | loop { 128 | if x.len() >= 2 && x[0] == '*' && x[1] == '/' { // found the */ 129 | break; 130 | } 131 | } 132 | } 133 | 134 | fn foo() { 135 | let this_ends = "a \"test/*."; 136 | call1(); 137 | call2(); 138 | let this_does_not = /* a /* nested */ comment " */ 139 | "*/another /*test 140 | call3(); 141 | */"; 142 | } 143 | 144 | fn foobar() { 145 | let does_not_start = // " 146 | "until here, 147 | test/* 148 | test"; // a quote: " 149 | let also_doesnt_start = /* " */ 150 | "until here, 151 | test,*/ 152 | test"; // another quote: " 153 | } 154 | 155 | fn foo() { 156 | let a = 4; // /* 157 | let b = 5; 158 | let c = 6; // */ 159 | } 160 | ``` 161 | 162 | # 错误报告 163 | 164 | 请包含错误消息,以及包含文件或文件结构的最低工作示例. 165 | 166 | This file crashes the program. 167 | 168 | 169 | \`\`\` 170 | \`\`\` 171 | 172 | [rust's enum style]: (https://github.com/rust-lang/rfcs/blob/master/text/0430-finalizing-naming-conventions.md#general-naming-conventions) 173 | 174 | [`tests/data/rust.rs`]: https://github.com/Aaronepower/tokei/blob/master/tests/data/rust.rs 175 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Tokei 2 | 3 | * [Language Addition](#language-addition) 4 | * [Bug Reports](#bug-reports) 5 | 6 | # Language Addition 7 | Currently tokei generates languages from the [`languages.json`](languages.json) 8 | file. JSON was decided to make it easy to add new languages, and change code 9 | structure without changing large data structures. Here we will go over the 10 | properties of a language in `languages.json`, through examples. 11 | 12 | ``` 13 | "JavaScript":{ 14 | "base":"c", 15 | "quotes":[ 16 | [ 17 | "\\\"", 18 | "\\\"" 19 | ], 20 | [ 21 | "'", 22 | "'" 23 | ], 24 | [ 25 | "`", 26 | "`" 27 | ] 28 | ], 29 | "extensions":[ 30 | "js" 31 | ] 32 | }, 33 | ``` 34 | 35 | Above is the JavaScript's definition. The first thing that needs to be defined 36 | is the key, the keys format should be same as 37 | [Rust's enum style]. 38 | As this key will be used in an enum for identifying the language. For a lot of 39 | language's this also works for showing the language when we print to the screen. 40 | However there are some languages whose names don't work with the enum style. 41 | For example `JSON` is usually shown in all caps, but that doesn't fit in Rust's 42 | enum style. So we have an additional optional field called `name`, which defines 43 | how the language should look when displayed to the user. 44 | 45 | ```json 46 | "Json" { 47 | "name": "JSON", 48 | ``` 49 | 50 | For defining comments has a few properties: firstly is the most commonly used 51 | `single` property which defines single line comments. Comments which don't 52 | continue onto the next line. 53 | 54 | ```rust 55 | let x = 5; // default x position 56 | let y = 0; // default y position 57 | ``` 58 | 59 | The `single` property expects an array of strings, as some languages have 60 | multiple syntaxes for defining a a single line comment. For example `PHP` allows 61 | both `#` and `//` as comments. 62 | 63 | ```json 64 | "Php": { 65 | "single": [ 66 | "#", 67 | "//" 68 | ] 69 | ``` 70 | 71 | For defining comments that also have a ending syntax, there is the `multi_line` 72 | property. 73 | 74 | ```rust 75 | let x = /* There is a reason 76 | for this comment I swear */ 77 | 10; 78 | ``` 79 | 80 | A lot of languages have the same commenting syntax usually inheriting from the 81 | authors previous language or preferred language. In order to avoid code reuse 82 | tokei's languages have a `base` property which says to use a common comment 83 | syntax. e.g. 84 | 85 | ```json 86 | "ActionScript":{ 87 | "base":"c", 88 | "extensions":[ 89 | "as" 90 | ] 91 | } 92 | ``` 93 | 94 | #### Bases 95 | 96 | - `blank` A language with no comments. 97 | - `c` Single: `//`, Multi line: `/* */`, Quotes: `" "` 98 | - `func` Multi line: `(* *)`, Quotes: `" "` 99 | - `html` Multi line: ``, Quotes: `" "` 100 | - `hash` Single: `#` 101 | - `haskell` Single: `--`, Multi line: `{- -}`, Nested: `true` 102 | - `pro` Single: `%`, Multi line: `/* */`, Quotes: `" "` 103 | 104 | 105 | Some languages have a single, standard filename with no extension 106 | like `Makefile` or `Dockerfile`. These can be defined with the 107 | `filenames` property: 108 | 109 | ```json 110 | "Makefile":{ 111 | "filenames":[ 112 | "makefile" 113 | ], 114 | "extensions":[ 115 | "makefile", 116 | "mak", 117 | "mk" 118 | ] 119 | } 120 | ``` 121 | 122 | Filenames should be all-lowercase, whether or not the filename 123 | typically has capital letters included. 124 | 125 | Note that filenames will **override** extensions with the 126 | following definition a file named `CMakeLists.txt` will be 127 | detected as a `CMake` file, not a `Text` file. 128 | 129 | ```json 130 | "Text":{ 131 | "extensions":[ 132 | "txt" 133 | ] 134 | }, 135 | "CMake":{ 136 | "filenames": [ 137 | "cmakelists.txt" 138 | ] 139 | } 140 | ``` 141 | 142 | # Tests 143 | A test file is required with language additions. The file should 144 | contain every variant comments and quotes, as well as a comment 145 | at the top of the file containing the manually verified lines, 146 | code, comments, blanks e.g. 147 | `// 39 lines 32 code 2 comments 5 blanks`. The comment should use 148 | the syntax of the language you're testing. A good example of a 149 | test file is [`tests/data/rust.rs`]. 150 | 151 | ```rust 152 | // 39 lines 32 code 2 comments 5 blanks 153 | 154 | /* /**/ */ 155 | fn main() { 156 | let start = "/*"; 157 | loop { 158 | if x.len() >= 2 && x[0] == '*' && x[1] == '/' { // found the */ 159 | break; 160 | } 161 | } 162 | } 163 | 164 | fn foo() { 165 | let this_ends = "a \"test/*."; 166 | call1(); 167 | call2(); 168 | let this_does_not = /* a /* nested */ comment " */ 169 | "*/another /*test 170 | call3(); 171 | */"; 172 | } 173 | 174 | fn foobar() { 175 | let does_not_start = // " 176 | "until here, 177 | test/* 178 | test"; // a quote: " 179 | let also_doesnt_start = /* " */ 180 | "until here, 181 | test,*/ 182 | test"; // another quote: " 183 | } 184 | 185 | fn foo() { 186 | let a = 4; // /* 187 | let b = 5; 188 | let c = 6; // */ 189 | } 190 | ``` 191 | 192 | # Bug Reports 193 | Please include the error message, and a minimum working example 194 | including the file, or file structure. 195 | 196 | ``` 197 | This file crashes the program. 198 | 199 | 200 | \`\`\` 201 | \`\`\` 202 | ``` 203 | 204 | [Rust's enum style]: (https://github.com/rust-lang/rfcs/blob/master/text/0430-finalizing-naming-conventions.md#general-naming-conventions) 205 | [`tests/data/rust.rs`]: https://github.com/Aaronepower/tokei/blob/master/tests/data/rust.rs 206 | -------------------------------------------------------------------------------- /resources/redis.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Gnuplot 10 | Produced by GNUPLOT 5.2 patchlevel 4 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 0 47 | 48 | 49 | 50 | 51 | 10 52 | 53 | 54 | 55 | 56 | 20 57 | 58 | 59 | 60 | 61 | 30 62 | 63 | 64 | 65 | 66 | 40 67 | 68 | 69 | 70 | 71 | 50 72 | 73 | 74 | 75 | 76 | 60 77 | 78 | 79 | 80 | 81 | tokei 82 | 83 | 84 | 85 | 86 | scc 87 | 88 | 89 | 90 | 91 | loc 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | Mean time (milliseconds) 101 | 102 | 103 | 104 | 105 | Program 106 | 107 | 108 | 109 | 110 | Performance on the Redis Repository w/ Cloc (Lower is better) 111 | 112 | 113 | mean 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /resources/unreal-engine.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Gnuplot 10 | Produced by GNUPLOT 5.2 patchlevel 4 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 0 47 | 48 | 49 | 50 | 51 | 1 52 | 53 | 54 | 55 | 56 | 2 57 | 58 | 59 | 60 | 61 | 3 62 | 63 | 64 | 65 | 66 | 4 67 | 68 | 69 | 70 | 71 | 5 72 | 73 | 74 | 75 | 76 | 6 77 | 78 | 79 | 80 | 81 | tokei 82 | 83 | 84 | 85 | 86 | scc 87 | 88 | 89 | 90 | 91 | loc 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | Mean time (seconds) 101 | 102 | 103 | 104 | 105 | Program 106 | 107 | 108 | 109 | 110 | Performance on the Unreal Engine Repository w/o Cloc (Lower is better) 111 | 112 | 113 | mean 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /resources/cpython-with-cloc.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Gnuplot 10 | Produced by GNUPLOT 5.2 patchlevel 4 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 0 47 | 48 | 49 | 50 | 51 | 1 52 | 53 | 54 | 55 | 56 | 2 57 | 58 | 59 | 60 | 61 | 3 62 | 63 | 64 | 65 | 66 | 4 67 | 68 | 69 | 70 | 71 | 5 72 | 73 | 74 | 75 | 76 | tokei 77 | 78 | 79 | 80 | 81 | scc 82 | 83 | 84 | 85 | 86 | loc 87 | 88 | 89 | 90 | 91 | cloc 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | Mean time (seconds) 101 | 102 | 103 | 104 | 105 | Program 106 | 107 | 108 | 109 | 110 | Performance on the Cpython Repository w/ Cloc (Lower is better) 111 | 112 | 113 | mean 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /resources/rust.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Gnuplot 10 | Produced by GNUPLOT 5.2 patchlevel 4 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 0 47 | 48 | 49 | 50 | 51 | 50 52 | 53 | 54 | 55 | 56 | 100 57 | 58 | 59 | 60 | 61 | 150 62 | 63 | 64 | 65 | 66 | 200 67 | 68 | 69 | 70 | 71 | 250 72 | 73 | 74 | 75 | 76 | 300 77 | 78 | 79 | 80 | 81 | 350 82 | 83 | 84 | 85 | 86 | tokei 87 | 88 | 89 | 90 | 91 | scc 92 | 93 | 94 | 95 | 96 | loc 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | Mean time (milliseconds) 106 | 107 | 108 | 109 | 110 | Program 111 | 112 | 113 | 114 | 115 | Performance on the Rust Repository w/o Cloc (Lower is better) 116 | 117 | 118 | mean 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /resources/cpython.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Gnuplot 10 | Produced by GNUPLOT 5.2 patchlevel 4 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 0 47 | 48 | 49 | 50 | 51 | 50 52 | 53 | 54 | 55 | 56 | 100 57 | 58 | 59 | 60 | 61 | 150 62 | 63 | 64 | 65 | 66 | 200 67 | 68 | 69 | 70 | 71 | 250 72 | 73 | 74 | 75 | 76 | 300 77 | 78 | 79 | 80 | 81 | 350 82 | 83 | 84 | 85 | 86 | tokei 87 | 88 | 89 | 90 | 91 | scc 92 | 93 | 94 | 95 | 96 | loc 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | Mean time (milliseconds) 106 | 107 | 108 | 109 | 110 | Program 111 | 112 | 113 | 114 | 115 | Performance on the Cpython Repository w/o Cloc (Lower is better) 116 | 117 | 118 | mean 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /resources/redis-with-cloc.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Gnuplot 10 | Produced by GNUPLOT 5.2 patchlevel 4 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 0 47 | 48 | 49 | 50 | 51 | 0.2 52 | 53 | 54 | 55 | 56 | 0.4 57 | 58 | 59 | 60 | 61 | 0.6 62 | 63 | 64 | 65 | 66 | 0.8 67 | 68 | 69 | 70 | 71 | 1 72 | 73 | 74 | 75 | 76 | 1.2 77 | 78 | 79 | 80 | 81 | 1.4 82 | 83 | 84 | 85 | 86 | tokei 87 | 88 | 89 | 90 | 91 | scc 92 | 93 | 94 | 95 | 96 | loc 97 | 98 | 99 | 100 | 101 | cloc 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | Mean time (seconds) 111 | 112 | 113 | 114 | 115 | Program 116 | 117 | 118 | 119 | 120 | Performance on the Redis Repository w/ Cloc (Lower is better) 121 | 122 | 123 | mean 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /resources/rust-with-cloc.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Gnuplot 10 | Produced by GNUPLOT 5.2 patchlevel 4 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 0 47 | 48 | 49 | 50 | 51 | 1 52 | 53 | 54 | 55 | 56 | 2 57 | 58 | 59 | 60 | 61 | 3 62 | 63 | 64 | 65 | 66 | 4 67 | 68 | 69 | 70 | 71 | 5 72 | 73 | 74 | 75 | 76 | 6 77 | 78 | 79 | 80 | 81 | 7 82 | 83 | 84 | 85 | 86 | 8 87 | 88 | 89 | 90 | 91 | tokei 92 | 93 | 94 | 95 | 96 | scc 97 | 98 | 99 | 100 | 101 | loc 102 | 103 | 104 | 105 | 106 | cloc 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | Mean time (seconds) 116 | 117 | 118 | 119 | 120 | Program 121 | 122 | 123 | 124 | 125 | Performance on the Rust Repository w/ Cloc (Lower is better) 126 | 127 | 128 | mean 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /resources/unreal-engine-with-cloc.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Gnuplot 10 | Produced by GNUPLOT 5.2 patchlevel 4 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 0 47 | 48 | 49 | 50 | 51 | 10 52 | 53 | 54 | 55 | 56 | 20 57 | 58 | 59 | 60 | 61 | 30 62 | 63 | 64 | 65 | 66 | 40 67 | 68 | 69 | 70 | 71 | 50 72 | 73 | 74 | 75 | 76 | 60 77 | 78 | 79 | 80 | 81 | 70 82 | 83 | 84 | 85 | 86 | 80 87 | 88 | 89 | 90 | 91 | tokei 92 | 93 | 94 | 95 | 96 | scc 97 | 98 | 99 | 100 | 101 | loc 102 | 103 | 104 | 105 | 106 | cloc 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | Mean time (seconds) 116 | 117 | 118 | 119 | 120 | Program 121 | 122 | 123 | 124 | 125 | Performance on the Unreal Engine Repository w/ Cloc (Lower is better) 126 | 127 | 128 | mean 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # tokei [![translate-svg]][translate-list] 2 | 3 | [translate-svg]: http://llever.com/translate.svg 4 | [translate-list]: https://github.com/chinanf-boy/chinese-translate-list 5 | 6 | 「 Tokei是一个显示代码信息的统计程序 」 7 | 8 | [中文](./readme.md) | [english](https://github.com/Aaronepower/tokei) 9 | 10 | 11 | --- 12 | 13 | ## 校对 ✅ 14 | 15 | 16 | 17 | 18 | 19 | 翻译的原文 | 与日期 | 最新更新 | 更多 20 | ---|---|---|--- 21 | [commit] | ⏰ 2018 8.29 | ![last] | [中文翻译][translate-list] 22 | 23 | [last]: https://img.shields.io/github/last-commit/Aaronepower/tokei.svg 24 | [commit]: https://github.com/Aaronepower/tokei/tree/a9a185e6e9c7d6c472736aadaf8ecc69d202b3c9 25 | 26 | 27 | 28 | ### 贡献 29 | 30 | 欢迎 👏 勘误/校对/更新贡献 😊 [具体贡献请看](https://github.com/chinanf-boy/chinese-translate-list#贡献) 31 | 32 | ## 生活 33 | 34 | [If help, **buy** me coffee —— 营养跟不上了,给我来瓶营养快线吧! 💰](https://github.com/chinanf-boy/live-need-money) 35 | 36 | --- 37 | 38 | 39 | # Tokei ([时计](https://en.wiktionary.org/wiki/%E6%99%82%E8%A8%88)) 40 | 41 | [![Linux build status](https://img.shields.io/travis/Aaronepower/tokei.svg?branch=master)](https://travis-ci.org/Aaronepower/tokei) 42 | [![Windows build status](https://ci.appveyor.com/api/projects/status/github/Aaronepower/tokei?svg=true)](https://ci.appveyor.com/project/Aaronepower/tokei) 43 | [![](https://img.shields.io/crates/d/tokei.svg)](https://crates.io/crates/tokei) 44 | [![](https://img.shields.io/github/issues-raw/Aaronepower/tokei.svg)](https://github.com/Aaronepower/tokei/issues) 45 | [![](https://tokei.rs/b1/github/Aaronepower/tokei?category=code)](https://github.com/Aaronepower/tokei) 46 | [![Documentation](https://docs.rs/tokei/badge.svg)](https://docs.rs/tokei/) 47 | [![Donate using Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/Aaronepower/donate) 48 | 49 | Tokei是一个显示代码信息的统计程序. Tokei将显示文件数,和这些文件中的总行数以及按语言分组的代码,注释和空格. 50 | 51 | ## 示例输出 52 | 53 | 这是tokei在自己的目录上运行 54 | 55 | [![asciicast](https://asciinema.org/a/d14m9g1d2cyo7wvrxh0z4ck6o.png)](https://asciinema.org/a/d14m9g1d2cyo7wvrxh0z4ck6o?autoplay=1) 56 | 57 | ## [文档](https://docs.rs/tokei) 58 | 59 | ## 目录 60 | 61 | 62 | 63 | 64 | 65 | - [特征](#%E7%89%B9%E5%BE%81) 66 | - [安装](#%E5%AE%89%E8%A3%85) 67 | - [自动](#%E8%87%AA%E5%8A%A8) 68 | - [Arch Linux](#arch-linux) 69 | - [Cargo](#cargo) 70 | - [Conda](#conda) 71 | - [Fedora](#fedora) 72 | - [FreeBSD](#freebsd) 73 | - [brew](#brew) 74 | - [Nix/NixOS](#nixnixos) 75 | - [手册](#%E6%89%8B%E5%86%8C) 76 | - [Linux](#linux) 77 | - [OSX](#osx) 78 | - [windows](#windows) 79 | - [如何使用Tokei](#%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8tokei) 80 | - [基本用法](#%E5%9F%BA%E6%9C%AC%E7%94%A8%E6%B3%95) 81 | - [多个文件夹](#%E5%A4%9A%E4%B8%AA%E6%96%87%E4%BB%B6%E5%A4%B9) 82 | - [排除文件夹](#%E6%8E%92%E9%99%A4%E6%96%87%E4%BB%B6%E5%A4%B9) 83 | - [排序输出](#%E6%8E%92%E5%BA%8F%E8%BE%93%E5%87%BA) 84 | - [输出文件统计信息](#%E8%BE%93%E5%87%BA%E6%96%87%E4%BB%B6%E7%BB%9F%E8%AE%A1%E4%BF%A1%E6%81%AF) 85 | - [输出为不同的格式](#%E8%BE%93%E5%87%BA%E4%B8%BA%E4%B8%8D%E5%90%8C%E7%9A%84%E6%A0%BC%E5%BC%8F) 86 | - [读取存储格式](#%E8%AF%BB%E5%8F%96%E5%AD%98%E5%82%A8%E6%A0%BC%E5%BC%8F) 87 | - [选项](#%E9%80%89%E9%A1%B9) 88 | - [徽章](#%E5%BE%BD%E7%AB%A0) 89 | - [插件](#%E6%8F%92%E4%BB%B6) 90 | - [支持的语言](#%E6%94%AF%E6%8C%81%E7%9A%84%E8%AF%AD%E8%A8%80) 91 | - [常见问题](#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98) 92 | - [Tokei说我有很多D代码,但我知道没有D代码!](#tokei%E8%AF%B4%E6%88%91%E6%9C%89%E5%BE%88%E5%A4%9Ad%E4%BB%A3%E7%A0%81%E4%BD%86%E6%88%91%E7%9F%A5%E9%81%93%E6%B2%A1%E6%9C%89d%E4%BB%A3%E7%A0%81) 93 | - [规范来源](#%E8%A7%84%E8%8C%83%E6%9D%A5%E6%BA%90) 94 | - [版权和许可](#%E7%89%88%E6%9D%83%E5%92%8C%E8%AE%B8%E5%8F%AF) 95 | 96 | 97 | 98 | ## 特征 99 | 100 | - Tokei是**非常快的**,看看我们的[对照](./COMPARISON.zh.md)文件,了解Tokei的速度与其他人的比较. 101 | 102 | - Tokei是**准确**,Tokei正确处理多行注释,嵌套注释,而不计算字符串中的注释. 提供准确的代码统计信息. 103 | 104 | - Tokei拥有广泛的语言,支持**150**语言及其各种扩展. 105 | 106 | - Tokei可以输出多种格式 (**CBOR**,**JSON**,**TOML**,**YAML**) ,容易存储和重复使用. 这些也可以在tokei中重复使用,将先前运行的统计数据与另一组进行组合. 107 | 108 | - Tokei可用**苹果电脑**,**Linux**,和**Windows**. 看到[安装说明](#安装)如何在您的平台上获得Tokei. 109 | 110 | - Tokei也是一个**rust-箱**允许您轻松地将其与其他项目集成. 111 | 112 | ## 安装 113 | 114 | ### 自动 115 | 116 | #### Arch Linux 117 | 118 | ```shell 119 | $ pacman -S tokei 120 | ``` 121 | 122 | #### Cargo 123 | 124 | ```shell 125 | $ cargo install tokei 126 | ``` 127 | 128 | #### Conda 129 | 130 | ```shell 131 | $ conda install -c conda-forge tokei 132 | ``` 133 | 134 | #### Fedora 135 | 136 | ```shell 137 | $ sudo dnf install tokei 138 | ``` 139 | 140 | #### FreeBSD 141 | 142 | ```shell 143 | $ pkg install tokei 144 | ``` 145 | 146 | #### brew 147 | 148 | ```shell 149 | $ brew install tokei 150 | ``` 151 | 152 | #### Nix/NixOS 153 | 154 | ```shell 155 | $ nix-env -i tokei 156 | ``` 157 | 158 | ### 手册 159 | 160 | 您可以在[发布页面](https://github.com/Aaronepower/tokei/releases)中下载预建的二进制文件,或从源创建. 161 | 162 | ```shell 163 | $ git clone https://github.com/Aaronepower/tokei.git 164 | $ cd tokei 165 | $ cargo build --release 166 | ``` 167 | 168 | ##### Linux 169 | 170 | # sudo mv target/release/tokei /usr/local/bin 171 | 172 | ##### OSX 173 | 174 | # sudo mv target/release/tokei /usr/local/bin/tokei 175 | 176 | ##### windows 177 | 178 | - 为tokei创建一个文件夹 179 | - 搜索`env` 180 | - 打开"编辑你的环境变量" 181 | - 编辑`PATH` 182 | - 将文件夹路径追加到字符串末尾即: `;C:/tokei/;` 183 | 184 | ## 如何使用Tokei 185 | 186 | #### 基本用法 187 | 188 | 这是使用tokei的基本方法. 这会报告`./foo`和所有子文件夹代码. 189 | 190 | ```shell 191 | $ tokei ./foo 192 | ``` 193 | 194 | #### 多个文件夹 195 | 196 | 要在同一个调用中对多个文件夹进行tokei报告,只需添加一个`逗号`或`一个空格`,后跟另一个路径. 197 | 198 | ```shell 199 | $ tokei ./foo ./bar ./baz 200 | ``` 201 | 202 | ```shell 203 | $ tokei ./foo, ./bar, ./baz 204 | ``` 205 | 206 | #### 排除文件夹 207 | 208 | Tokei会忽略`.gitignore`和`.ignore`文件中的匹配,你也可以使用`--exclude`忽略文件的选项. 该`--exclude`具有与`.gitignore`相同的语义. 209 | 210 | ```shell 211 | $ tokei ./foo --exclude *.rs 212 | ``` 213 | 214 | #### 排序输出 215 | 216 | 默认情况下,tokei按语言名称按字母顺序排序,但使用`--sort`也可以按任何列排序. 217 | 218 | `blanks, code, comments, lines` 219 | 220 | ```shell 221 | $ tokei ./foo --sort code 222 | ``` 223 | 224 | #### 输出文件统计信息 225 | 226 | 默认情况下,tokei仅输出语言的总和,如使用`--files`,还可以输出单个文件统计信息. 227 | 228 | ```shell 229 | $ tokei ./foo --files 230 | ``` 231 | 232 | #### 输出为不同的格式 233 | 234 | Tokei通常输出为为终端设计的漂亮的人类可读格式. 还有使用`--output`选项各种其他格式,对于将数据带入另一个程序更有用. 235 | 236 | **注意:** 这个版本的tokei编译时,没有任何序列化格式,以启用序列化,使用features标志重新安装tokei. 237 | 238 | ```shell 239 | ALL: 240 | cargo install tokei --features all 241 | 242 | JSON: 243 | cargo install tokei --features json 244 | 245 | CBOR: 246 | cargo install tokei --features cbor 247 | 248 | YAML: 249 | cargo install tokei --features yaml 250 | 251 | CBOR: 252 | cargo install tokei --features cbor 253 | ``` 254 | 255 | **目前支持的格式** 256 | 257 | - JSON`--output json` 258 | - YAML`--output yaml` 259 | - TOML`--output toml` 260 | - CBOR`--output cbor` 261 | 262 | ```shell 263 | $ tokei ./foo --output json 264 | ``` 265 | 266 | #### 读取存储格式 267 | 268 | Tokei还可以将之前结果中添加的输出格式输入到当前运行中. Tokei可以获取文件的路径,传入的格式作为选项的值,或者 从stdin获取. 269 | 270 | ```shell 271 | $ tokei ./foo --input ./stats.json 272 | ``` 273 | 274 | ## 选项 275 | 276 | tokei 7.0.1 277 | Aaron P. + Contributors 278 | A utility that allows you to count code, quickly. 279 | 280 | USAGE: 281 | tokei [FLAGS] [OPTIONS] [--] [input]... 282 | 283 | FLAGS: 284 | -f, --files Will print out statistics on individual files. 285 | -h, --help Prints help information 286 | -l, --languages Prints out supported languages and their extensions. 287 | -V, --version Prints version information 288 | -v, --verbose Set log output level: 289 | 1: to show unknown file extensions, 290 | 2: reserved for future debugging, 291 | 3: enable file level trace. Not recommended on multiple files 292 | 293 | OPTIONS: 294 | -e, --exclude ... 忽略包含该单词的所有文件和目录。 295 | -i, --input 提供之前的tokei运行的统计数据。 可以给出文件路径,或 'stdin' 296 | 从stdin读取。 297 | -o, --output 以特定格式输出Tokei。 [值:cbor,json,toml,yaml] 298 | -s, --sort 根据列[值: files, lines, blanks, code, comments]对语言进行排序 299 | 300 | ARGS: 301 | ... The input file(s)/directory(ies) to be counted. 302 | 303 | ## 徽章 304 | 305 | Tokei支持徽章. 例如[![](https://tokei.rs/b1/github/Aaronepower/tokei)](https://github.com/Aaronepower/tokei). 306 | 307 | [![](https://tokei.rs/b1/github/Aaronepower/tokei)](https://github.com/Aaronepower/tokei). 308 | 309 | Tokei的URL方案如下. 310 | 311 | https://tokei.rs/{host: values: github|gitlab}/{Repo Owner eg: Aaronepower}/{Repo name eg: tokei} 312 | 313 | 默认情况下,徽章将显示项目的LoC (*代码行*) ,你也可以通过使用指定它来显示不同的类别`?category=`请求参数. 它可以是`code`,`blanks`,`files`,`lines`,`comments`,示例显示总行数: 314 | 315 | [![](https://tokei.rs/b1/github/Aaronepower/tokei?category=lines)](https://github.com/Aaronepower/tokei). 316 | 317 | ## 插件 318 | 319 | 感谢贡献者tokei,现在可以作为一些文本编辑器的插件. 320 | 321 | - [Vim](https://github.com/vmchale/tokei-vim)通过[vmchale](https://github.com/vmchale/) 322 | 323 | ## 支持的语言 324 | 325 | 如果您要添加某种语言,请随时提交包含以下信息的提取请求. 如果你不确定,看看[`languages.json`](./languages.json)如何定义其他语言. 326 | 327 | - 语言名称 328 | - 文件扩展名 329 | - 注释语法 (*它有区块注释吗?它和C一样吗?*) 330 | - 字符串文字语法 331 | 332 | ``` 333 | ABAP 334 | ActionScript 335 | Ada 336 | Alex 337 | Agda 338 | ASP 339 | ASP.NET 340 | Assembly 341 | Autoconf 342 | SH 343 | AutoHotKey 344 | BASH 345 | FISH 346 | Batch 347 | C 348 | C Header 349 | C# 350 | C Shell 351 | Cabal 352 | Cassius 353 | Ceylon 354 | Clojure 355 | CMake 356 | COBOL 357 | CoffeeScript 358 | Cogent 359 | ColdFusion 360 | ColdFusion CFScript 361 | Coq 362 | C++ 363 | C++ Header 364 | CSS 365 | Crystal 366 | D 367 | Dart 368 | Device Tree 369 | Dockerfile 370 | Elixir 371 | Elm 372 | Emacs Development Environment 373 | Emacs Lisp 374 | Erlang 375 | FEN 376 | Forth 377 | F* 378 | F# 379 | FORTRAN Legacy 380 | FORTRAN Modern 381 | GDScript 382 | GLSL 383 | Go 384 | Groovy 385 | Happy 386 | Handlebars 387 | Haskell 388 | Haxe 389 | HCL 390 | HEX 391 | HTML 392 | Hamlet 393 | Idris 394 | Intel HEX 395 | Isabelle 396 | JAI 397 | Java 398 | JavaScript 399 | JSON 400 | JSX 401 | Julia 402 | Julius 403 | Kotlin 404 | Lean 405 | LESS 406 | LD Script 407 | LISP 408 | Lua 409 | Lucius 410 | Madlang 411 | Makefile 412 | Markdown 413 | Meson 414 | Mint 415 | ModuleDef 416 | Mustache 417 | Nim 418 | Nix 419 | OCaml 420 | Objective C 421 | Objective C++ 422 | Org mode 423 | Oz 424 | Pascal 425 | Perl 426 | PHP 427 | Polly 428 | Processing 429 | Prolog 430 | Protocol Buffers 431 | PSL Assertions 432 | PureScript 433 | Python 434 | QCL 435 | QML 436 | R 437 | Racket 438 | Rakefile 439 | Razor 440 | ReStructuredText 441 | Ruby 442 | Ruby HTML 443 | Rust 444 | Sass 445 | Scala 446 | Scons 447 | SRecode Template 448 | Standard ML 449 | Specman e 450 | SPICE Netlists 451 | SQL 452 | SVG 453 | Swift 454 | SystemVerilog 455 | TCL 456 | TeX 457 | Plain Text 458 | TOML 459 | TypeScript 460 | Unreal Script 461 | Ur/Web 462 | Vala 463 | VB6 464 | VBScript 465 | Verilog 466 | Verilog argument files 467 | VHDL 468 | Vim Script 469 | Wolfram 470 | Xaml 471 | XML 472 | Xtend 473 | YAML 474 | Zsh 475 | ``` 476 | 477 | ## 常见问题 478 | 479 | ### Tokei说我有很多D代码,但我知道没有D代码! 480 | 481 | 这可能是由于`gcc`生成`.d`文件. 在D用户决定使用其他文件扩展名之前,您始终可以排除`.d`的文件,使用`-e --exclude`这样的选项 482 | 483 | $ tokei . -e *.d 484 | 485 | ## 规范来源 486 | 487 | 这个仓库的规范来源是托管的[GitHub上](https://github.com/Aaronepower/tokei). 如果您有GitHub帐户,请提出您的问题,并在那里提出请求. 488 | 489 | ## 版权和许可 490 | 491 | (C) Aaron Power和贡献者的2015版权所有 492 | 493 | 请参阅 [CONTRIBUTORS.md](./CONTRIBUTORS.zh.md) 以获取完整的贡献者列表. 494 | 495 | Tokei遵循 MIT许可和Apache许可 (版本2.0) 的条款. 496 | 497 | 看到[许可证APACHE](./LICENCE-APACHE),[LICENSE-MIT](./LICENCE-MIT)了解更多信息. 498 | -------------------------------------------------------------------------------- /en.md: -------------------------------------------------------------------------------- 1 | # Tokei ([時計](https://en.wiktionary.org/wiki/%E6%99%82%E8%A8%88)) 2 | 3 | [![Linux build status](https://img.shields.io/travis/Aaronepower/tokei.svg?branch=master)](https://travis-ci.org/Aaronepower/tokei) 4 | [![Windows build status](https://ci.appveyor.com/api/projects/status/github/Aaronepower/tokei?svg=true)](https://ci.appveyor.com/project/Aaronepower/tokei) 5 | [![](https://img.shields.io/crates/d/tokei.svg)](https://crates.io/crates/tokei) 6 | [![](https://img.shields.io/github/issues-raw/Aaronepower/tokei.svg)](https://github.com/Aaronepower/tokei/issues) 7 | [![](https://tokei.rs/b1/github/Aaronepower/tokei?category=code)](https://github.com/Aaronepower/tokei) 8 | [![Documentation](https://docs.rs/tokei/badge.svg)](https://docs.rs/tokei/) 9 | [![Donate using Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/Aaronepower/donate) 10 | 11 | Tokei is a program that displays statistics about your code. Tokei will show number of files, total lines within those files and code, comments, and blanks grouped by language. 12 | 13 | ## Example Output 14 | This is tokei running on its own directory 15 | 16 | [![asciicast](https://asciinema.org/a/d14m9g1d2cyo7wvrxh0z4ck6o.png)](https://asciinema.org/a/d14m9g1d2cyo7wvrxh0z4ck6o?autoplay=1) 17 | 18 | ## [Documentation](https://docs.rs/tokei) 19 | 20 | ## Table of Contents 21 | 22 | - [Features](#features) 23 | - [Installation](#installation) 24 | - [Automatic](#automatic) 25 | - [Arch Linux](#arch-linux) 26 | - [Cargo](#cargo) 27 | - [Conda](#conda) 28 | - [Fedora](#fedora) 29 | - [FreeBSD](#freebsd) 30 | - [Homebrew](#homebrew) 31 | - [Nix/NixOS](#nix/nixos) 32 | - [Manual](#manual) 33 | - [How to use Tokei](#how-to-use-tokei) 34 | - [Options](#options) 35 | - [Badges](#badges) 36 | - [Plugins](#plugins) 37 | - [Supported Languages](#supported-languages) 38 | - [Changelog](CHANGELOG.md) 39 | - [Common Issues](#common-issues) 40 | - [Canonical Source](#canonical-source) 41 | - [Copyright and License](#copyright-and-license) 42 | 43 | ## Features 44 | 45 | - Tokei is **very fast**, check out our [comparison](./COMPARISON.md) document 46 | to see how Tokei's speed compares to others. 47 | 48 | - Tokei is **accurate**, Tokei correctly handles multi line comments, 49 | nested comments, and not counting comments that are in strings. Providing an 50 | accurate code statistics. 51 | 52 | - Tokei has huge range of languages, supporting over **150** languages, and 53 | their various extensions. 54 | 55 | - Tokei can output in multiple formats(**CBOR**, **JSON**, **TOML**, **YAML**) 56 | allowing Tokei's output to be easily stored, and reused. These can also be 57 | reused in tokei combining a previous run's statistics with another set. 58 | 59 | - Tokei is available on **Mac**, **Linux**, and **Windows**. See [installation 60 | instructions](#installation) for how to get Tokei on your platform. 61 | 62 | - Tokei is also a **library** allowing you to easily integrate it with other 63 | projects. 64 | 65 | ## Installation 66 | 67 | ### Automatic 68 | 69 | #### Arch Linux 70 | ```shell 71 | $ pacman -S tokei 72 | ``` 73 | 74 | #### Cargo 75 | ```shell 76 | $ cargo install tokei 77 | ``` 78 | 79 | #### Conda 80 | ```shell 81 | $ conda install -c conda-forge tokei 82 | ``` 83 | 84 | #### Fedora 85 | ```shell 86 | $ sudo dnf install tokei 87 | ``` 88 | 89 | #### FreeBSD 90 | ```shell 91 | $ pkg install tokei 92 | ``` 93 | 94 | #### Homebrew 95 | ```shell 96 | $ brew install tokei 97 | ``` 98 | 99 | #### Nix/NixOS 100 | ```shell 101 | $ nix-env -i tokei 102 | ``` 103 | 104 | ### Manual 105 | You can download prebuilt binaries in the 106 | [releases section](https://github.com/Aaronepower/tokei/releases), or create 107 | from source. 108 | ```shell 109 | $ git clone https://github.com/Aaronepower/tokei.git 110 | $ cd tokei 111 | $ cargo build --release 112 | ``` 113 | ##### Linux 114 | ``` 115 | # sudo mv target/release/tokei /usr/local/bin 116 | ``` 117 | ##### OSX 118 | ``` 119 | # sudo mv target/release/tokei /usr/local/bin/tokei 120 | ``` 121 | ##### Windows 122 | - Create a folder for tokei 123 | - search for `env` 124 | - open "edit your enviroment variables" 125 | - edit `PATH` 126 | - append folder path to the end of the string ie: `;C:/tokei/;` 127 | 128 | ## How to use Tokei 129 | 130 | #### Basic usage 131 | 132 | This is the basic way to use tokei. Which will report on the code in `./foo` 133 | and all subfolders. 134 | 135 | ```shell 136 | $ tokei ./foo 137 | ``` 138 | 139 | #### Multiple folders 140 | To have tokei report on multiple folders in the same call simply add a comma, 141 | or a space followed by another path. 142 | 143 | ```shell 144 | $ tokei ./foo ./bar ./baz 145 | ``` 146 | ```shell 147 | $ tokei ./foo, ./bar, ./baz 148 | ``` 149 | 150 | #### Excluding folders 151 | Tokei will respect all `.gitignore` and `.ignore` files, and you can use 152 | the `--exclude` option to exclude any additional files. The `--exclude` flag has 153 | the same semantics as `.gitignore`. 154 | 155 | ```shell 156 | $ tokei ./foo --exclude *.rs 157 | ``` 158 | 159 | #### Sorting output 160 | By default tokei sorts alphabetically by language name, however using `--sort` 161 | tokei can also sort by any of the columns. 162 | 163 | `blanks, code, comments, lines` 164 | 165 | ```shell 166 | $ tokei ./foo --sort code 167 | ``` 168 | 169 | #### Outputting file statistics 170 | By default tokei only outputs the total of the languages, and using `--files` 171 | flag tokei can also output individual file statistics. 172 | 173 | ```shell 174 | $ tokei ./foo --files 175 | ``` 176 | 177 | #### Outputting into different formats 178 | Tokei normally outputs into a nice human readable format designed for terminals. 179 | There is also using the `--output` option various other formats that are more 180 | useful for bringing the data into another program. 181 | 182 | **Note:** This version of tokei was compiled without any serialization formats, to enable serialization, reinstall 183 | tokei with the features flag. 184 | 185 | ```shell 186 | ALL: 187 | cargo install tokei --features all 188 | 189 | JSON: 190 | cargo install tokei --features json 191 | 192 | CBOR: 193 | cargo install tokei --features cbor 194 | 195 | YAML: 196 | cargo install tokei --features yaml 197 | 198 | CBOR: 199 | cargo install tokei --features cbor 200 | ``` 201 | 202 | **Currently supported formats** 203 | - JSON `--output json` 204 | - YAML `--output yaml` 205 | - TOML `--output toml` 206 | - CBOR `--output cbor` 207 | 208 | ```shell 209 | $ tokei ./foo --output json 210 | ``` 211 | 212 | #### Reading in stored formats 213 | Tokei can also take in the outputted formats added in the previous results to it's 214 | current run. Tokei can take either a path to a file, the format passed in as a 215 | value to the option, or from stdin. 216 | 217 | ```shell 218 | $ tokei ./foo --input ./stats.json 219 | ``` 220 | 221 | ## Options 222 | 223 | ``` 224 | tokei 7.0.1 225 | Aaron P. + Contributors 226 | A utility that allows you to count code, quickly. 227 | 228 | USAGE: 229 | tokei [FLAGS] [OPTIONS] [--] [input]... 230 | 231 | FLAGS: 232 | -f, --files Will print out statistics on individual files. 233 | -h, --help Prints help information 234 | -l, --languages Prints out supported languages and their extensions. 235 | -V, --version Prints version information 236 | -v, --verbose Set log output level: 237 | 1: to show unknown file extensions, 238 | 2: reserved for future debugging, 239 | 3: enable file level trace. Not recommended on multiple files 240 | 241 | OPTIONS: 242 | -e, --exclude ... Ignore all files & directories containing the word. 243 | -i, --input Gives statistics from a previous tokei run. Can be given a file path, or "stdin" to 244 | read from stdin. 245 | -o, --output Outputs Tokei in a specific format. [values: cbor, json, toml, yaml] 246 | -s, --sort Sort languages based on column [values: files, lines, blanks, code, comments] 247 | 248 | ARGS: 249 | ... The input file(s)/directory(ies) to be counted. 250 | ``` 251 | 252 | ## Badges 253 | Tokei has support for badges. For example 254 | [![](https://tokei.rs/b1/github/Aaronepower/tokei)](https://github.com/Aaronepower/tokei). 255 | 256 | ``` 257 | [![](https://tokei.rs/b1/github/Aaronepower/tokei)](https://github.com/Aaronepower/tokei). 258 | ``` 259 | 260 | Tokei's URL scheme is as follows. 261 | 262 | ``` 263 | https://tokei.rs/{host: values: github|gitlab}/{Repo Owner eg: Aaronepower}/{Repo name eg: tokei} 264 | ``` 265 | 266 | By default the badge will show the repo's LoC(_Lines of Code_), you can also 267 | specify for it to show a different category, by using the `?category=` query 268 | string. It can be either `code`, `blanks`, `files`, `lines`, `comments`, 269 | Example show total lines: 270 | 271 | ``` 272 | [![](https://tokei.rs/b1/github/Aaronepower/tokei?category=lines)](https://github.com/Aaronepower/tokei). 273 | ``` 274 | 275 | ## Plugins 276 | Thanks to contributors tokei is now available as a plugin for some text editors. 277 | 278 | - [Vim](https://github.com/vmchale/tokei-vim) by [vmchale](https://github.com/vmchale/) 279 | 280 | ## Supported Languages 281 | 282 | If there is a language that you want added, feel free to submit a pull request 283 | with the following information. If you're unsure have a look at 284 | [`languages.json`](./languages.json) to see how other languages are defined. 285 | 286 | - Name of language 287 | - File Extension(s) 288 | - The comment syntax (_Does it have block comments? is it the same as C?_) 289 | - The string literal syntax 290 | 291 | ``` 292 | ABAP 293 | ActionScript 294 | Ada 295 | Alex 296 | Agda 297 | ASP 298 | ASP.NET 299 | Assembly 300 | Autoconf 301 | SH 302 | AutoHotKey 303 | BASH 304 | FISH 305 | Batch 306 | C 307 | C Header 308 | C# 309 | C Shell 310 | Cabal 311 | Cassius 312 | Ceylon 313 | Clojure 314 | CMake 315 | COBOL 316 | CoffeeScript 317 | Cogent 318 | ColdFusion 319 | ColdFusion CFScript 320 | Coq 321 | C++ 322 | C++ Header 323 | CSS 324 | Crystal 325 | D 326 | Dart 327 | Device Tree 328 | Dockerfile 329 | Elixir 330 | Elm 331 | Emacs Development Environment 332 | Emacs Lisp 333 | Erlang 334 | FEN 335 | Forth 336 | F* 337 | F# 338 | FORTRAN Legacy 339 | FORTRAN Modern 340 | GDScript 341 | GLSL 342 | Go 343 | Groovy 344 | Happy 345 | Handlebars 346 | Haskell 347 | Haxe 348 | HCL 349 | HEX 350 | HTML 351 | Hamlet 352 | Idris 353 | Intel HEX 354 | Isabelle 355 | JAI 356 | Java 357 | JavaScript 358 | JSON 359 | JSX 360 | Julia 361 | Julius 362 | Kotlin 363 | Lean 364 | LESS 365 | LD Script 366 | LISP 367 | Lua 368 | Lucius 369 | Madlang 370 | Makefile 371 | Markdown 372 | Meson 373 | Mint 374 | ModuleDef 375 | Mustache 376 | Nim 377 | Nix 378 | OCaml 379 | Objective C 380 | Objective C++ 381 | Org mode 382 | Oz 383 | Pascal 384 | Perl 385 | PHP 386 | Polly 387 | Processing 388 | Prolog 389 | Protocol Buffers 390 | PSL Assertions 391 | PureScript 392 | Python 393 | QCL 394 | QML 395 | R 396 | Racket 397 | Rakefile 398 | Razor 399 | ReStructuredText 400 | Ruby 401 | Ruby HTML 402 | Rust 403 | Sass 404 | Scala 405 | Scons 406 | SRecode Template 407 | Standard ML 408 | Specman e 409 | SPICE Netlists 410 | SQL 411 | SVG 412 | Swift 413 | SystemVerilog 414 | TCL 415 | TeX 416 | Plain Text 417 | TOML 418 | TypeScript 419 | Unreal Script 420 | Ur/Web 421 | Vala 422 | VB6 423 | VBScript 424 | Verilog 425 | Verilog argument files 426 | VHDL 427 | Vim Script 428 | Wolfram 429 | Xaml 430 | XML 431 | Xtend 432 | YAML 433 | Zsh 434 | ``` 435 | 436 | ## Common issues 437 | 438 | ### Tokei says I have a lot of D code, but I know there is no D code! 439 | This is likely due to `gcc` generating `.d` files. Until the D people decide on 440 | a different file extension, you can always exclude `.d` files using the 441 | `-e --exclude` flag like so 442 | 443 | ``` 444 | $ tokei . -e *.d 445 | ``` 446 | 447 | ## Canonical Source 448 | The canonical source of this repo is hosted on 449 | [GitHub](https://github.com/Aaronepower/tokei). If you have a GitHub account, 450 | please make your issues, and pull requests there. 451 | 452 | ## Copyright and License 453 | (C) Copyright 2015 by Aaron Power and contributors 454 | 455 | See CONTRIBUTORS.md for a full list of contributors. 456 | 457 | Tokei is distributed under the terms of both the MIT license and the Apache License (Version 2.0). 458 | 459 | See [LICENCE-APACHE](./LICENCE-APACHE), [LICENCE-MIT](./LICENCE-MIT) for more information. 460 | -------------------------------------------------------------------------------- /languages.json: -------------------------------------------------------------------------------- 1 | { 2 | "languages":{ 3 | "Abap":{ 4 | "name":"ABAP", 5 | "line_comment":[ 6 | "*", 7 | "\\\"" 8 | ], 9 | "extensions":[ 10 | "abap" 11 | ] 12 | }, 13 | "ActionScript":{ 14 | "base":"c", 15 | "extensions":[ 16 | "as" 17 | ] 18 | }, 19 | "Ada":{ 20 | "line_comment":[ 21 | "--" 22 | ], 23 | "extensions":[ 24 | "ada", 25 | "adb", 26 | "ads", 27 | "pad" 28 | ] 29 | }, 30 | "Alex":{ 31 | "extensions":[ 32 | "x" 33 | ] 34 | }, 35 | "Agda":{ 36 | "base": "haskell", 37 | "extensions":[ 38 | "agda" 39 | ] 40 | }, 41 | "Assembly":{ 42 | "line_comment":[ 43 | ";" 44 | ], 45 | "quotes":[ 46 | ["\\\"", "\\\""], 47 | ["'", "'"] 48 | ], 49 | "extensions":[ 50 | "s", 51 | "asm" 52 | ] 53 | }, 54 | "Asp":{ 55 | "name":"ASP", 56 | "line_comment":[ 57 | "'", 58 | "REM" 59 | ], 60 | "extensions":[ 61 | "asa", 62 | "asp" 63 | ] 64 | }, 65 | "AspNet":{ 66 | "name":"ASP.NET", 67 | "multi_line":[ 68 | [""], 69 | ["<%--", "-->"] 70 | ], 71 | "extensions":[ 72 | "asax", 73 | "ascx", 74 | "asmx", 75 | "aspx", 76 | "master", 77 | "sitemap", 78 | "webinfo" 79 | ] 80 | }, 81 | "Autoconf":{ 82 | "line_comment":[ 83 | "#", 84 | "dnl" 85 | ], 86 | "extensions":[ 87 | "in" 88 | ] 89 | }, 90 | "AutoHotKey":{ 91 | "line_comment":[ 92 | ";" 93 | ], 94 | "multi_line":[ 95 | ["/*", "*/"] 96 | ], 97 | "extensions":[ 98 | "ahk" 99 | ] 100 | }, 101 | "Sh":{ 102 | "name":"Shell", 103 | "base":"hash", 104 | "quotes":[ 105 | ["\\\"", "\\\""], 106 | ["'", "'"] 107 | ], 108 | "env":[ 109 | "sh" 110 | ], 111 | "extensions":[ 112 | "sh" 113 | ] 114 | }, 115 | "Bash":{ 116 | "name":"BASH", 117 | "base":"hash", 118 | "quotes":[ 119 | ["\\\"", "\\\""], 120 | ["'", "'"] 121 | ], 122 | "env":[ 123 | "bash" 124 | ], 125 | "extensions":[ 126 | "bash" 127 | ] 128 | }, 129 | "BrightScript":{ 130 | "quotes":[ 131 | ["\\\"", "\\\""] 132 | ], 133 | "line_comment":[ 134 | "'", 135 | "REM" 136 | ], 137 | "extensions":[ 138 | "brs" 139 | ] 140 | }, 141 | "Elvish":{ 142 | "base":"hash", 143 | "quotes":[ 144 | ["\\\"", "\\\""], 145 | ["'", "'"] 146 | ], 147 | "env":[ 148 | "elvish" 149 | ], 150 | "extensions":[ 151 | "elv" 152 | ] 153 | }, 154 | "Fish":{ 155 | "base":"hash", 156 | "quotes":[ 157 | ["\\\"", "\\\""], 158 | ["'", "'"] 159 | ], 160 | "env":[ 161 | "fish" 162 | ], 163 | "extensions":[ 164 | "fish" 165 | ] 166 | }, 167 | "Batch":{ 168 | "line_comment":[ 169 | "REM", 170 | "::" 171 | ], 172 | "extensions":[ 173 | "bat", 174 | "btm", 175 | "cmd" 176 | ] 177 | }, 178 | "C":{ 179 | "base":"c", 180 | "extensions":[ 181 | "c", 182 | "ec", 183 | "pgc" 184 | ] 185 | }, 186 | "Cabal":{ 187 | "base":"haskell", 188 | "extensions":[ 189 | "cabal" 190 | ] 191 | }, 192 | "Cassius":{ 193 | "base":"c", 194 | "quotes":[ 195 | ["\\\"", "\\\""], 196 | ["'", "'"] 197 | ], 198 | "extensions":[ 199 | "cassius" 200 | ] 201 | }, 202 | "Ceylon":{ 203 | "base":"c", 204 | "quotes":[ 205 | ["\\\"", "\\\""], 206 | ["\\\"\\\"\\\"", "\\\"\\\"\\\""] 207 | ], 208 | "extensions":[ 209 | "ceylon" 210 | ] 211 | }, 212 | "CHeader":{ 213 | "name":"C Header", 214 | "base":"c", 215 | "extensions":[ 216 | "h" 217 | ] 218 | }, 219 | "Clojure":{ 220 | "line_comment":[ 221 | ";" 222 | ], 223 | "quotes":[ 224 | ["\\\"", "\\\""] 225 | ], 226 | "extensions":[ 227 | "clj" 228 | ] 229 | }, 230 | "ClojureScript":{ 231 | "line_comment":[ 232 | ";" 233 | ], 234 | "quotes":[ 235 | ["\\\"", "\\\""] 236 | ], 237 | "extensions":[ 238 | "cljs" 239 | ] 240 | }, 241 | "ClojureC":{ 242 | "line_comment":[ 243 | ";" 244 | ], 245 | "quotes":[ 246 | ["\\\"", "\\\""] 247 | ], 248 | "extensions":[ 249 | "cljc" 250 | ] 251 | }, 252 | "CMake": { 253 | "line_comment":[ 254 | "#" 255 | ], 256 | "quotes":[ 257 | ["\\\"", "\\\""] 258 | ], 259 | "extensions":[ 260 | "cmake" 261 | ], 262 | "filenames":[ 263 | "cmakelists.txt" 264 | ] 265 | }, 266 | "Cobol": { 267 | "name":"COBOL", 268 | "line_comment":[ 269 | "*" 270 | ], 271 | "extensions":[ 272 | "cob", 273 | "cbl", 274 | "ccp", 275 | "cobol", 276 | "cpy" 277 | ] 278 | }, 279 | "CoffeeScript":{ 280 | "line_comment":[ 281 | "#" 282 | ], 283 | "multi_line":[ 284 | ["###", "###"] 285 | ], 286 | "quotes":[ 287 | ["\\\"", "\\\""], 288 | ["'", "'"] 289 | ], 290 | "extensions":[ 291 | "coffee" 292 | ] 293 | }, 294 | "Cogent":{ 295 | "line_comment":[ 296 | "--" 297 | ], 298 | "extensions":[ 299 | "cogent" 300 | ] 301 | }, 302 | "ColdFusion":{ 303 | "multi_line":[ 304 | [""] 305 | ], 306 | "quotes":[ 307 | ["\\\"", "\\\""], 308 | ["'", "'"] 309 | ], 310 | "extensions":[ 311 | "cfm" 312 | ] 313 | }, 314 | "ColdFusionScript":{ 315 | "name":"ColdFusion CFScript", 316 | "base":"c", 317 | "extensions":[ 318 | "cfc" 319 | ] 320 | }, 321 | "Coq":{ 322 | "base":"func", 323 | "extensions":[ 324 | "v" 325 | ] 326 | }, 327 | "Cpp":{ 328 | "name":"C++", 329 | "base":"c", 330 | "extensions":[ 331 | "cc", 332 | "cpp", 333 | "cxx", 334 | "c++", 335 | "pcc" 336 | ] 337 | }, 338 | "CppHeader":{ 339 | "name":"C++ Header", 340 | "base":"c", 341 | "extensions":[ 342 | "hh", 343 | "hpp", 344 | "hxx", 345 | "inl", 346 | "ipp" 347 | ] 348 | }, 349 | "Crystal":{ 350 | "line_comment":[ 351 | "#" 352 | ], 353 | "quotes":[ 354 | ["\\\"", "\\\""], 355 | ["'", "'"] 356 | ], 357 | "extensions":[ 358 | "cr" 359 | ] 360 | }, 361 | "VisualBasic":{ 362 | "name":"Visual Basic", 363 | "quotes":[ 364 | ["\\\"", "\\\""] 365 | ], 366 | "line_comment":[ 367 | "'" 368 | ], 369 | "extensions":[ 370 | "vb" 371 | ] 372 | }, 373 | "CSharp":{ 374 | "name":"C#", 375 | "base":"c", 376 | "extensions":[ 377 | "cs" 378 | ] 379 | }, 380 | "CShell":{ 381 | "name":"C Shell", 382 | "base":"hash", 383 | "env":[ 384 | "csh" 385 | ], 386 | "extensions":[ 387 | "csh" 388 | ] 389 | }, 390 | "Css":{ 391 | "name":"CSS", 392 | "base":"c", 393 | "quotes":[ 394 | ["\\\"", "\\\""], 395 | ["'", "'"] 396 | ], 397 | "extensions":[ 398 | "css" 399 | ] 400 | }, 401 | "D":{ 402 | "base":"c", 403 | "quotes":[ 404 | ["\\\"", "\\\""], 405 | ["'", "'"] 406 | ], 407 | "nested_comments":[ 408 | ["/+", "+/"] 409 | ], 410 | "extensions":[ 411 | "d" 412 | ] 413 | }, 414 | "Dart":{ 415 | "base":"c", 416 | "quotes":[ 417 | ["\\\"", "\\\""], 418 | ["'", "'"], 419 | ["\\\"\\\"\\\"", "\\\"\\\"\\\""], 420 | ["'''", "'''"] 421 | ], 422 | "extensions":[ 423 | "dart" 424 | ] 425 | }, 426 | "DeviceTree":{ 427 | "name":"Device Tree", 428 | "base":"c", 429 | "extensions":[ 430 | "dts", 431 | "dtsi" 432 | ] 433 | }, 434 | "DreamMaker":{ 435 | "name":"Dream Maker", 436 | "base":"c", 437 | "nested":true, 438 | "extensions":[ 439 | "dm", 440 | "dme" 441 | ], 442 | "quotes":[ 443 | ["{\\\"", "\\\"}"], 444 | ["'", "'"] 445 | ] 446 | }, 447 | "Dockerfile":{ 448 | "line_comment":[ 449 | "#" 450 | ], 451 | "extensions":[ 452 | "dockerfile", 453 | "dockerignore" 454 | ], 455 | "filenames":[ 456 | "dockerfile" 457 | ], 458 | "quotes":[ 459 | ["\\\"", "\\\""], 460 | ["'", "'"] 461 | ] 462 | }, 463 | "Edn":{ 464 | "line_comment":[ 465 | ";" 466 | ], 467 | "extensions":[ 468 | "edn" 469 | ] 470 | }, 471 | "Elisp":{ 472 | "name":"Emacs Lisp", 473 | "line_comment":[ 474 | ";" 475 | ], 476 | "extensions":[ 477 | "el" 478 | ] 479 | }, 480 | "Elixir":{ 481 | "line_comment":[ 482 | "#" 483 | ], 484 | "quotes":[ 485 | ["\\\"\\\"\\\"", "\\\"\\\"\\\""], 486 | ["\\\"", "\\\""], 487 | ["'''", "'''"], 488 | ["'", "'"] 489 | ], 490 | "extensions":[ 491 | "ex", 492 | "exs" 493 | ] 494 | }, 495 | "Elm":{ 496 | "base":"haskell", 497 | "extensions":[ 498 | "elm" 499 | ] 500 | }, 501 | "EmacsDevEnv":{ 502 | "name":"Emacs Dev Env", 503 | "line_comment":[ 504 | ";" 505 | ], 506 | "extensions":[ 507 | "ede" 508 | ] 509 | }, 510 | "Erlang":{ 511 | "line_comment":[ 512 | "%" 513 | ], 514 | "extensions":[ 515 | "erl", 516 | "hrl" 517 | ] 518 | }, 519 | "FEN":{ 520 | "name":"FEN", 521 | "blank": true, 522 | "extensions":[ 523 | "fen" 524 | ] 525 | }, 526 | "Fstar":{ 527 | "name":"F*", 528 | "base":"func", 529 | "extensions":[ 530 | "fst" 531 | ] 532 | }, 533 | "Forth":{ 534 | "line_comment":[ 535 | "\\\\" 536 | ], 537 | "multi_line":[ 538 | ["( ", ")"] 539 | ], 540 | "extensions":[ 541 | "4th", 542 | "forth", 543 | "fr", 544 | "frt", 545 | "fth", 546 | "f83", 547 | "fb", 548 | "fpm", 549 | "e4", 550 | "rx", 551 | "ft" 552 | ] 553 | }, 554 | "FortranLegacy":{ 555 | "name":"FORTRAN Legacy", 556 | "line_comment":[ 557 | "c", 558 | "C", 559 | "!", 560 | "*" 561 | ], 562 | "quotes":[ 563 | ["\\\"", "\\\""], 564 | ["'", "'"] 565 | ], 566 | "extensions":[ 567 | "f", 568 | "for", 569 | "ftn", 570 | "f77", 571 | "pfo" 572 | ] 573 | }, 574 | "FortranModern":{ 575 | "name":"FORTRAN Modern", 576 | "line_comment":[ 577 | "!" 578 | ], 579 | "quotes":[ 580 | ["\\\"", "\\\""] 581 | ], 582 | "extensions":[ 583 | "f03", 584 | "f08", 585 | "f90", 586 | "f95" 587 | ] 588 | }, 589 | "FSharp":{ 590 | "name":"F#", 591 | "line_comment":[ 592 | "//" 593 | ], 594 | "multi_line":[ 595 | ["(*", "*)"] 596 | ], 597 | "quotes":[ 598 | ["\\\"", "\\\""] 599 | ], 600 | "extensions":[ 601 | "fs", 602 | "fsi", 603 | "fsx", 604 | "fsscript" 605 | ] 606 | }, 607 | "GdScript":{ 608 | "name":"GDScript", 609 | "base":"hash", 610 | "quotes":[ 611 | ["\\\"", "\\\""], 612 | ["'", "'"], 613 | ["\\\"\\\"\\\"", "\\\"\\\"\\\""] 614 | ], 615 | "extensions":[ 616 | "gd" 617 | ] 618 | }, 619 | "Glsl":{ 620 | "name":"GLSL", 621 | "base":"c", 622 | "extensions":[ 623 | "vert", 624 | "tesc", 625 | "tese", 626 | "geom", 627 | "frag", 628 | "comp" 629 | ] 630 | }, 631 | "Go":{ 632 | "base":"c", 633 | "extensions":[ 634 | "go" 635 | ] 636 | }, 637 | "Groovy":{ 638 | "base":"c", 639 | "extensions":[ 640 | "groovy", 641 | "grt", 642 | "gtpl", 643 | "gvy" 644 | ] 645 | }, 646 | "Happy":{ 647 | "extensions":[ 648 | "y", 649 | "ly" 650 | ] 651 | }, 652 | "Handlebars":{ 653 | "multi_line":[ 654 | [""], 655 | ["{{!", "}}"] 656 | ], 657 | "quotes":[ 658 | ["\\\"", "\\\""], 659 | ["'", "'"] 660 | ], 661 | "extensions":[ 662 | "hbs", 663 | "handlebars" 664 | ] 665 | }, 666 | "Haskell":{ 667 | "base": "haskell", 668 | "extensions":[ 669 | "hs" 670 | ] 671 | }, 672 | "Hcl":{ 673 | "name":"HCL", 674 | "line_comment":[ 675 | "#", 676 | "//" 677 | ], 678 | "multi_line":[ 679 | ["/*", "*/"] 680 | ], 681 | "quotes":[ 682 | ["\\\"", "\\\""] 683 | ], 684 | "extensions":[ 685 | "tf", 686 | "tfvars" 687 | ] 688 | }, 689 | "Html":{ 690 | "name":"HTML", 691 | "base":"html", 692 | "quotes":[ 693 | ["\\\"", "\\\""], 694 | ["'", "'"] 695 | ], 696 | "extensions":[ 697 | "html", 698 | "htm" 699 | ] 700 | }, 701 | "Hamlet":{ 702 | "base":"html", 703 | "quotes":[ 704 | ["\\\"", "\\\""], 705 | ["'", "'"] 706 | ], 707 | "extensions":[ 708 | "hamlet" 709 | ] 710 | }, 711 | "Haxe":{ 712 | "base":"c", 713 | "quotes":[ 714 | ["\\\"", "\\\""], 715 | ["'", "'"] 716 | ], 717 | "extensions":[ 718 | "hx" 719 | ] 720 | }, 721 | "Hex":{ 722 | "name":"HEX", 723 | "blank": true, 724 | "extensions":[ 725 | "hex" 726 | ] 727 | }, 728 | "Idris":{ 729 | "base":"haskell", 730 | "quotes":[ 731 | ["\\\"", "\\\""], 732 | ["\\\"\\\"\\\"", "\\\"\\\"\\\""] 733 | ], 734 | "extensions":[ 735 | "idr", 736 | "lidr" 737 | ], 738 | "nested":true 739 | }, 740 | "IntelHex":{ 741 | "name":"Intel HEX", 742 | "blank": true, 743 | "extensions":[ 744 | "ihex" 745 | ] 746 | }, 747 | "Isabelle":{ 748 | "line_comment":[ 749 | "--" 750 | ], 751 | "multi_line":[ 752 | ["{*", "*}"], 753 | ["(*", "*)"], 754 | ["‹", "›"], 755 | ["\\\\", "\\\\"] 756 | ], 757 | "quotes":[ 758 | ["''", "''"] 759 | ], 760 | "extensions":[ 761 | "thy" 762 | ] 763 | }, 764 | "Jai":{ 765 | "name":"JAI", 766 | "base":"c", 767 | "extensions":[ 768 | "jai" 769 | ], 770 | "nested":true 771 | }, 772 | "Java":{ 773 | "base":"c", 774 | "extensions":[ 775 | "java" 776 | ] 777 | }, 778 | "JavaScript":{ 779 | "base":"c", 780 | "quotes":[ 781 | ["\\\"", "\\\""], 782 | ["'", "'"], 783 | ["`", "`"] 784 | ], 785 | "extensions":[ 786 | "js" 787 | ] 788 | }, 789 | "Json":{ 790 | "name":"JSON", 791 | "blank": true, 792 | "extensions":[ 793 | "json" 794 | ] 795 | }, 796 | "Jsx":{ 797 | "name":"JSX", 798 | "base":"c", 799 | "quotes":[ 800 | ["\\\"", "\\\""], 801 | ["'", "'"], 802 | ["`", "`"] 803 | ], 804 | "extensions":[ 805 | "jsx" 806 | ] 807 | }, 808 | "Julia":{ 809 | "line_comment":[ 810 | "#" 811 | ], 812 | "multi_line":[ 813 | ["#=", "=#"] 814 | ], 815 | "quotes":[ 816 | ["\\\"", "\\\""], 817 | ["\\\"\\\"\\\"", "\\\"\\\"\\\""] 818 | ], 819 | "nested":true, 820 | "extensions":[ 821 | "jl" 822 | ] 823 | }, 824 | "Julius":{ 825 | "base":"c", 826 | "quotes":[ 827 | ["\\\"", "\\\""], 828 | ["'", "'"], 829 | ["`", "`"] 830 | ], 831 | "extensions":[ 832 | "julius" 833 | ] 834 | }, 835 | "KakouneScript":{ 836 | "name":"Kakoune script", 837 | "line_comment":[ 838 | "#" 839 | ], 840 | "quotes":[ 841 | ["\\\"", "\\\""], 842 | ["'", "'"] 843 | ], 844 | "extensions":[ 845 | "kak" 846 | ] 847 | }, 848 | "Kotlin":{ 849 | "base":"c", 850 | "nested":true, 851 | "quotes":[ 852 | ["\\\"", "\\\""], 853 | ["\\\"\\\"\\\"", "\\\"\\\"\\\""] 854 | ], 855 | "extensions":[ 856 | "kt", 857 | "kts" 858 | ] 859 | }, 860 | "Lean":{ 861 | "line_comment":[ 862 | "--" 863 | ], 864 | "multi_line":[ 865 | ["/-", "-/"] 866 | ], 867 | "nested":true, 868 | "extensions":[ 869 | "lean", 870 | "hlean" 871 | ] 872 | }, 873 | "Less":{ 874 | "name":"LESS", 875 | "base":"c", 876 | "extensions":[ 877 | "less" 878 | ], 879 | "quotes":[ 880 | ["\\\"", "\\\""], 881 | ["'", "'"] 882 | ] 883 | }, 884 | "LinkerScript":{ 885 | "name":"LD Script", 886 | "base":"c", 887 | "extensions":[ 888 | "lds" 889 | ] 890 | }, 891 | "Lisp":{ 892 | "line_comment":[ 893 | ";" 894 | ], 895 | "multi_line":[ 896 | ["#|", "|#"] 897 | ], 898 | "nested":true, 899 | "extensions":[ 900 | "lisp", 901 | "lsp" 902 | ] 903 | }, 904 | "Lua":{ 905 | "line_comment":[ 906 | "--" 907 | ], 908 | "multi_line":[ 909 | ["--[[", "]]"] 910 | ], 911 | "quotes":[ 912 | ["\\\"", "\\\""], 913 | ["'", "'"] 914 | ], 915 | "extensions":[ 916 | "lua" 917 | ] 918 | }, 919 | "Lucius":{ 920 | "base":"c", 921 | "quotes":[ 922 | ["\\\"", "\\\""], 923 | ["'", "'"] 924 | ], 925 | "extensions":[ 926 | "lucius" 927 | ] 928 | }, 929 | "Madlang":{ 930 | "extensions":[ 931 | "mad" 932 | ], 933 | "line_comment":[ 934 | "#" 935 | ], 936 | "multi_line":[ 937 | ["{#", "#}"] 938 | ] 939 | }, 940 | "Makefile":{ 941 | "base":"hash", 942 | "extensions":[ 943 | "makefile", 944 | "mak", 945 | "mk" 946 | ], 947 | "filenames":[ 948 | "makefile" 949 | ] 950 | }, 951 | "Markdown":{ 952 | "blank": true, 953 | "extensions":[ 954 | "md", 955 | "markdown" 956 | ] 957 | }, 958 | "ModuleDef": { 959 | "name": "Module-Definition", 960 | "extensions": ["def"], 961 | "line_comment": [";"] 962 | }, 963 | "Meson":{ 964 | "line_comment":[ 965 | "#" 966 | ], 967 | "quotes":[ 968 | ["'", "'"], 969 | ["'''", "'''"] 970 | ], 971 | "filenames":[ 972 | "meson.build", 973 | "meson_options.txt" 974 | ] 975 | }, 976 | "Mint":{ 977 | "blank": true, 978 | "extensions":[ 979 | "mint" 980 | ] 981 | }, 982 | "Mustache":{ 983 | "multi_line":[ 984 | ["{{!", "}}"] 985 | ], 986 | "quotes":[ 987 | ["\\\"", "\\\""], 988 | ["'", "'"] 989 | ], 990 | "extensions":[ 991 | "mustache" 992 | ] 993 | }, 994 | "Nim":{ 995 | "base":"hash", 996 | "quotes":[ 997 | ["\\\"", "\\\""], 998 | ["\\\"\\\"\\\"", "\\\"\\\"\\\""] 999 | ], 1000 | "extensions":[ 1001 | "nim" 1002 | ] 1003 | }, 1004 | "Nix":{ 1005 | "base":"c", 1006 | "line_comment":[ 1007 | "#" 1008 | ], 1009 | "extensions":[ 1010 | "nix" 1011 | ] 1012 | }, 1013 | "ObjectiveC":{ 1014 | "name":"Objective C", 1015 | "base":"c", 1016 | "extensions":[ 1017 | "m" 1018 | ] 1019 | }, 1020 | "ObjectiveCpp":{ 1021 | "name":"Objective C++", 1022 | "base":"c", 1023 | "extensions":[ 1024 | "mm" 1025 | ] 1026 | }, 1027 | "OCaml":{ 1028 | "base":"func", 1029 | "extensions":[ 1030 | "ml", 1031 | "mli", 1032 | "re", 1033 | "rei" 1034 | ] 1035 | }, 1036 | "Org":{ 1037 | "line_comment":[ 1038 | "# " 1039 | ], 1040 | "extensions":[ 1041 | "org" 1042 | ] 1043 | }, 1044 | "Oz":{ 1045 | "base":"pro", 1046 | "extensions":[ 1047 | "oz" 1048 | ] 1049 | }, 1050 | "Pascal":{ 1051 | "multi_line":[ 1052 | ["{", "}"], 1053 | ["(*", "*)"], 1054 | ["{", "*)"], 1055 | ["(*", "}"] 1056 | ], 1057 | "quotes":[ 1058 | ["'", "'"] 1059 | ], 1060 | "extensions":[ 1061 | "pas" 1062 | ] 1063 | }, 1064 | "Perl":{ 1065 | "line_comment":[ 1066 | "#" 1067 | ], 1068 | "multi_line":[ 1069 | ["=pod", "=cut"] 1070 | ], 1071 | "quotes":[ 1072 | ["\\\"", "\\\""], 1073 | ["'", "'"] 1074 | ], 1075 | "extensions":[ 1076 | "pl", 1077 | "pm" 1078 | ] 1079 | }, 1080 | "Php":{ 1081 | "name":"PHP", 1082 | "line_comment":[ 1083 | "#", 1084 | "//" 1085 | ], 1086 | "multi_line":[ 1087 | ["/*", "*/"] 1088 | ], 1089 | "quotes":[ 1090 | ["\\\"", "\\\""], 1091 | ["'", "'"] 1092 | ], 1093 | "extensions":[ 1094 | "php" 1095 | ] 1096 | }, 1097 | "Polly":{ 1098 | "base":"html", 1099 | "extensions":[ 1100 | "polly" 1101 | ] 1102 | }, 1103 | "Processing":{ 1104 | "base":"c", 1105 | "extensions":[ 1106 | "pde" 1107 | ] 1108 | }, 1109 | "Prolog":{ 1110 | "base":"pro", 1111 | "extensions":[ 1112 | "p", 1113 | "pro" 1114 | ] 1115 | }, 1116 | "PSL":{ 1117 | "name":"PSL Assertion", 1118 | "base":"c", 1119 | "extensions":[ 1120 | "psl" 1121 | ] 1122 | }, 1123 | "Protobuf":{ 1124 | "name":"Protocol Buffers", 1125 | "line_comment":[ 1126 | "//" 1127 | ], 1128 | "extensions":[ 1129 | "proto" 1130 | ] 1131 | }, 1132 | "PureScript":{ 1133 | "base":"haskell", 1134 | "extensions":[ 1135 | "purs" 1136 | ] 1137 | }, 1138 | "Python":{ 1139 | "base":"hash", 1140 | "quotes":[ 1141 | ["\\\"", "\\\""], 1142 | ["'", "'"], 1143 | ["\\\"\\\"\\\"", "\\\"\\\"\\\""], 1144 | ["'''", "'''"] 1145 | ], 1146 | "env":[ 1147 | "python", 1148 | "python2", 1149 | "python3" 1150 | ], 1151 | "extensions":[ 1152 | "py" 1153 | ] 1154 | }, 1155 | "Qcl":{ 1156 | "name":"QCL", 1157 | "base":"c", 1158 | "extensions":[ 1159 | "qcl" 1160 | ] 1161 | }, 1162 | "Qml":{ 1163 | "name":"QML", 1164 | "base": "c", 1165 | "quotes":[ 1166 | ["\\\"", "\\\""], 1167 | ["'", "'"] 1168 | ], 1169 | "extensions":[ 1170 | "qml" 1171 | ] 1172 | }, 1173 | "R":{ 1174 | "base":"hash", 1175 | "extensions":[ 1176 | "r" 1177 | ] 1178 | }, 1179 | "Racket":{ 1180 | "line_comment":[ 1181 | ";" 1182 | ], 1183 | "multi_line":[ 1184 | ["#|", "|#"] 1185 | ], 1186 | "nested":true, 1187 | "extensions":[ 1188 | "rkt" 1189 | ] 1190 | }, 1191 | "Rakefile":{ 1192 | "line_comment":[ 1193 | "#" 1194 | ], 1195 | "multi_line":[ 1196 | ["=begin", "=end"] 1197 | ], 1198 | "quotes":[ 1199 | ["\\\"", "\\\""], 1200 | ["'", "'"] 1201 | ], 1202 | "filenames":[ 1203 | "rakefile" 1204 | ], 1205 | "extensions":[ 1206 | "rake" 1207 | ] 1208 | }, 1209 | "Razor":{ 1210 | "multi_line":[ 1211 | [""], 1212 | ["@*", "*@"] 1213 | ], 1214 | "extensions":[ 1215 | "cshtml" 1216 | ] 1217 | }, 1218 | "Ruby":{ 1219 | "line_comment":[ 1220 | "#" 1221 | ], 1222 | "multi_line":[ 1223 | ["=begin", "=end"] 1224 | ], 1225 | "quotes":[ 1226 | ["\\\"", "\\\""], 1227 | ["'", "'"] 1228 | ], 1229 | "extensions":[ 1230 | "rb" 1231 | ] 1232 | }, 1233 | "RubyHtml":{ 1234 | "name":"Ruby HTML", 1235 | "base":"html", 1236 | "quotes":[ 1237 | ["\\\"", "\\\""], 1238 | ["'", "'"] 1239 | ], 1240 | "extensions":[ 1241 | "rhtml" 1242 | ] 1243 | }, 1244 | "Rust":{ 1245 | "base":"c", 1246 | "nested":true, 1247 | "extensions":[ 1248 | "rs" 1249 | ], 1250 | "quotes": [ 1251 | ["\\\"", "\\\""], 1252 | ["r#\\\"", "\\\"#"], 1253 | ["#\\\"", "\\\"#"] 1254 | ] 1255 | }, 1256 | "ReStructuredText":{ 1257 | "blank": true, 1258 | "extensions":[ 1259 | "rst" 1260 | ] 1261 | }, 1262 | "Sass":{ 1263 | "base":"c", 1264 | "quotes":[ 1265 | ["\\\"", "\\\""], 1266 | ["'", "'"] 1267 | ], 1268 | "extensions":[ 1269 | "sass", 1270 | "scss" 1271 | ] 1272 | }, 1273 | "Scala":{ 1274 | "base":"c", 1275 | "extensions":[ 1276 | "sc", 1277 | "scala" 1278 | ] 1279 | }, 1280 | "Scheme":{ 1281 | "line_comment":[ 1282 | ";" 1283 | ], 1284 | "multi_line":[ 1285 | ["#|", "|#"] 1286 | ], 1287 | "nested":true, 1288 | "extensions":[ 1289 | "scm", 1290 | "ss" 1291 | ] 1292 | }, 1293 | "Scons":{ 1294 | "base":"hash", 1295 | "quotes":[ 1296 | ["\\\"", "\\\""], 1297 | ["'", "'"], 1298 | ["\\\"\\\"\\\"", "\\\"\\\"\\\""], 1299 | ["'''", "'''"] 1300 | ], 1301 | "filenames":[ 1302 | "sconstruct", 1303 | "sconscript" 1304 | ] 1305 | }, 1306 | "Sml":{ 1307 | "name":"Standard ML (SML)", 1308 | "base":"func", 1309 | "extensions":[ 1310 | "sml" 1311 | ] 1312 | }, 1313 | "SpecmanE":{ 1314 | "name":"Specman e", 1315 | "line_comment":[ 1316 | "--", 1317 | "//" 1318 | ], 1319 | "multi_line":[ 1320 | ["'>", "<'"] 1321 | ], 1322 | "extensions":[ 1323 | "e" 1324 | ] 1325 | }, 1326 | "Spice":{ 1327 | "name":"Spice Netlist", 1328 | "line_comment":[ 1329 | "*" 1330 | ], 1331 | "extensions":[ 1332 | "ckt" 1333 | ] 1334 | }, 1335 | "Sql":{ 1336 | "name":"SQL", 1337 | "line_comment":[ 1338 | "--" 1339 | ], 1340 | "multi_line":[ 1341 | ["/*", "*/"] 1342 | ], 1343 | "quotes":[ 1344 | ["'", "'"] 1345 | ], 1346 | "extensions":[ 1347 | "sql" 1348 | ] 1349 | }, 1350 | "SRecode":{ 1351 | "name": "SRecode Template", 1352 | "line_comment":[ 1353 | ";;" 1354 | ], 1355 | "extensions":[ 1356 | "srt" 1357 | ] 1358 | }, 1359 | "Svg":{ 1360 | "name":"SVG", 1361 | "base":"html", 1362 | "extensions":[ 1363 | "svg" 1364 | ] 1365 | }, 1366 | "Swift":{ 1367 | "base":"c", 1368 | "nested":true, 1369 | "extensions":[ 1370 | "swift" 1371 | ] 1372 | }, 1373 | "SystemVerilog":{ 1374 | "base":"c", 1375 | "extensions":[ 1376 | "sv", 1377 | "svh" 1378 | ] 1379 | }, 1380 | "Tcl":{ 1381 | "name":"TCL", 1382 | "base":"hash", 1383 | "quotes":[ 1384 | ["\\\"", "\\\""], 1385 | ["'", "'"] 1386 | ], 1387 | "extensions":[ 1388 | "tcl" 1389 | ] 1390 | }, 1391 | "Tex":{ 1392 | "name":"TeX", 1393 | "line_comment":[ 1394 | "%" 1395 | ], 1396 | "extensions":[ 1397 | "tex", 1398 | "sty" 1399 | ] 1400 | }, 1401 | "Text":{ 1402 | "name":"Plain Text", 1403 | "blank": true, 1404 | "extensions":[ 1405 | "text", 1406 | "txt" 1407 | ] 1408 | }, 1409 | "Toml":{ 1410 | "name":"TOML", 1411 | "base":"hash", 1412 | "quotes":[ 1413 | ["\\\"", "\\\""], 1414 | ["'", "'"], 1415 | ["\\\"\\\"\\\"", "\\\"\\\"\\\""], 1416 | ["'''", "'''"] 1417 | ], 1418 | "extensions":[ 1419 | "toml" 1420 | ] 1421 | }, 1422 | "TypeScript":{ 1423 | "base":"c", 1424 | "quotes":[ 1425 | ["\\\"", "\\\""], 1426 | ["'", "'"], 1427 | ["`", "`"] 1428 | ], 1429 | "extensions":[ 1430 | "ts", 1431 | "tsx" 1432 | ] 1433 | }, 1434 | "UnrealScript":{ 1435 | "name":"Unreal Script", 1436 | "base":"c", 1437 | "extensions":[ 1438 | "uc", 1439 | "uci", 1440 | "upkg" 1441 | ] 1442 | }, 1443 | "UrWeb":{ 1444 | "name":"Ur/Web", 1445 | "base":"func", 1446 | "extensions":[ 1447 | "ur", 1448 | "urs" 1449 | ] 1450 | }, 1451 | "UrWebProject":{ 1452 | "name":"Ur/Web Project", 1453 | "line_comment":[ 1454 | "#" 1455 | ], 1456 | "extensions":[ 1457 | "urp" 1458 | ] 1459 | }, 1460 | "Vala":{ 1461 | "base":"c", 1462 | "extensions":[ 1463 | "vala" 1464 | ] 1465 | }, 1466 | "VB6":{ 1467 | "name":"VB6", 1468 | "line_comment":[ 1469 | "'" 1470 | ], 1471 | "extensions":[ 1472 | "frm", 1473 | "bas", 1474 | "cls" 1475 | ] 1476 | }, 1477 | "VBScript":{ 1478 | "name":"VBScript", 1479 | "line_comment":[ 1480 | "'", 1481 | "REM" 1482 | ], 1483 | "extensions":[ 1484 | "vbs" 1485 | ] 1486 | }, 1487 | "Verilog":{ 1488 | "base":"c", 1489 | "extensions":[ 1490 | "vg", 1491 | "vh" 1492 | ] 1493 | }, 1494 | "VerilogArgsFile":{ 1495 | "name":"Verilog Args File", 1496 | "extensions":[ 1497 | "irunargs", 1498 | "xrunargs" 1499 | ] 1500 | }, 1501 | "Vhdl":{ 1502 | "name":"VHDL", 1503 | "line_comment":[ 1504 | "--" 1505 | ], 1506 | "extensions":[ 1507 | "vhd" 1508 | ] 1509 | }, 1510 | "VimScript":{ 1511 | "name":"Vim Script", 1512 | "line_comment":[ 1513 | "\\\"" 1514 | ], 1515 | "quotes":[ 1516 | ["\\\"", "\\\""], 1517 | ["'", "'"] 1518 | ], 1519 | "extensions":[ 1520 | "vim" 1521 | ] 1522 | }, 1523 | "Vue":{ 1524 | "name":"Vue", 1525 | "base":"html", 1526 | "quotes":[ 1527 | ["\\\"", "\\\""], 1528 | ["'", "'"], 1529 | ["`", "`"] 1530 | ], 1531 | "extensions":[ 1532 | "vue" 1533 | ] 1534 | }, 1535 | "Wolfram":{ 1536 | "base":"func", 1537 | "extensions":[ 1538 | "nb", 1539 | "wl" 1540 | ] 1541 | }, 1542 | "Xaml":{ 1543 | "name":"XAML", 1544 | "base":"html", 1545 | "extensions":[ 1546 | "xaml" 1547 | ] 1548 | }, 1549 | "Xml":{ 1550 | "name":"XML", 1551 | "base":"html", 1552 | "extensions":[ 1553 | "xml" 1554 | ] 1555 | }, 1556 | "XSL":{ 1557 | "name":"XSL", 1558 | "base":"html", 1559 | "extensions":[ 1560 | "xsl", 1561 | "xslt" 1562 | ] 1563 | }, 1564 | "MsBuild":{ 1565 | "name":"MSBuild", 1566 | "base":"html", 1567 | "extensions":[ 1568 | "csproj", 1569 | "vbproj", 1570 | "fsproj", 1571 | "props", 1572 | "targets" 1573 | ] 1574 | }, 1575 | "Xtend":{ 1576 | "base":"c", 1577 | "quotes":[ 1578 | ["\\\"", "\\\""], 1579 | ["'", "'"], 1580 | ["'''", "'''"] 1581 | ], 1582 | "extensions":[ 1583 | "xtend" 1584 | 1585 | ] 1586 | }, 1587 | "Yaml":{ 1588 | "name":"YAML", 1589 | "base":"hash", 1590 | "quotes":[ 1591 | ["\\\"", "\\\""], 1592 | ["'", "'"] 1593 | ], 1594 | "extensions":[ 1595 | "yaml", 1596 | "yml" 1597 | ] 1598 | }, 1599 | "Zig":{ 1600 | "line_comment":[ 1601 | "//" 1602 | ], 1603 | "quotes":[ 1604 | ["\\\"", "\\\""], 1605 | ["\\\\", "\n"] 1606 | ], 1607 | "extensions":[ 1608 | "zig" 1609 | ] 1610 | }, 1611 | "Zsh":{ 1612 | "base":"hash", 1613 | "quotes":[ 1614 | ["\\\"", "\\\""], 1615 | ["'", "'"] 1616 | ], 1617 | "extensions":[ 1618 | "zsh" 1619 | ] 1620 | } 1621 | } 1622 | } 1623 | -------------------------------------------------------------------------------- /COMPARISON.md: -------------------------------------------------------------------------------- 1 | # Comparing code counters 2 | This document is a compilation of various benchmarks and comparisons between 3 | code counters, namely `tokei`, `cloc`, `scc`, and `loc`. This document seeks to 4 | compare performance, and accuracy of the code counters. `polyglot` is not 5 | currently included as it was unabled to be installed on the machine at the time 6 | of writing. 7 | 8 | ## Preamble 9 | All performance and accuracy comparisons were done on a 15-inch MacBook Pro, 10 | with a 2.7GHz Intel Core i7 processor and 16GB 2133 MHz LPDDR3 RAM running macOS 11 | High Sierra 10.13.6. All benchmarks were done using [hyperfine]. 12 | 13 | * Tokei Version: 8.0.0 14 | * Cloc Version: 1.76 15 | * Loc Version: 0.4.1 16 | * Scc Version: 1.7.0 17 | 18 | ## Performance 19 | Performance benchmarks were performed against four large open source 20 | repositories; [Unreal Engine 4][Unreal](Hidden behind free signup), [Rust], 21 | [CPython], and [Redis]. For clarity two versions of graphs are presented as 22 | cloc's speeds are exponentially higher than the others so they presented with 23 | and without cloc. 24 | 25 | #### Repository Versions 26 | | Repository | Commit hash | 27 | |:---|---:| 28 | | CPython | 3738fadc670274ecc4649f51b52a93602820a375 | 29 | | Redis | 39c70e728b5af0c50989ffbc05e568099f3e081b | 30 | | Rust | 727eabd68143e968d8826ee29b8ea7792d29fa96 | 31 | | Unreal Engine 4 | 8696faa54bf2f89ca50d34e6fb3dcc461a810185 | 32 | 33 | #### Performance on the CPython Repository 34 | | Command | Mean [ms] | Min…Max [ms] | 35 | |:---|---:|---:| 36 | | `tokei` | 162.6 ± 6.1 | 157.0…184.8 | 37 | | `scc` | 349.0 ± 6.9 | 341.9…365.4 | 38 | | `loc` | 100.8 ± 6.1 | 93.5…119.0 | 39 | | `cloc` | 3889.4 ± 327.6 | 3769.4…4820.8 | 40 | 41 | ![A performance comparison between the programs shown as a histogram with cloc.](./resources/cpython-with-cloc.svg) 42 | ![A performance comparison between the programs shown as a histogram without cloc.](./resources/cpython.svg) 43 | 44 | #### Performance on the Redis Repository 45 | | Command | Mean [ms] | Min…Max [ms] | 46 | |:---|---:|---:| 47 | | `tokei` | 32.7 ± 1.4 | 30.0…36.2 | 48 | | `scc` | 50.5 ± 1.3 | 48.3…53.3 | 49 | | `loc` | 29.4 ± 5.0 | 23.3…45.9 | 50 | | `cloc` | 1288.4 ± 6.3 | 1276.1…1296.5 | 51 | 52 | ![A performance comparison between the programs shown as a histogram with cloc.](./resources/redis-with-cloc.svg) 53 | ![A performance comparison between the programs shown as a histogram without cloc.](./resources/redis.svg) 54 | 55 | #### Performance on the Rust Repository 56 | | Program | Mean [ms] | Min…Max [ms] | 57 | |:---|---:|---:| 58 | | `tokei` | 257.3 ± 8.1 | 244.3…270.2 | 59 | | `scc` | 316.9 ± 13.8 | 302.2…345.7 | 60 | | `loc` | 246.4 ± 11.2 | 222.7…263.1 | 61 | | `cloc` | 6864.0 ± 57.4 | 6805.3…6996.4 | 62 | 63 | ![A performance comparison between the programs shown as a histogram with cloc.](./resources/rust-with-cloc.svg) 64 | ![A performance comparison between the programs shown as a histogram without cloc.](./resources/rust.svg) 65 | 66 | #### Performance on the Unreal Engine Repository 67 | | Command | Mean [ms] | Min…Max [ms] | 68 | |:---|---:|---:| 69 | | `tokei` | 2705.3 ± 105.8 | 2584.4…2874.6 | 70 | | `scc` | 5308.6 ± 238.5 | 5036.4…5655.3 | 71 | | `loc` | 2350.0 ± 152.9 | 2208.1…2687.9 | 72 | | `cloc` | 72389.9 ± 12385.2 | 58032.0…97798.6 | 73 | 74 | ![A performance comparison between the programs shown as a histogram with cloc.](./resources/unreal-engine-with-cloc.svg) 75 | ![A performance comparison between the programs shown as a histogram without cloc.](./resources/unreal-engine.svg) 76 | 77 | ## Accuracy 78 | It's important for a code counter to not just be faster, but to be accurate. 79 | Below is a small Rust file with a lot of edge cases taken from Tokei's test 80 | suite. The first line is the human expected number of lines, comments, code, and 81 | blanks. Using this as a sample of a code counters sample, we'll display a table 82 | of the reported number of lines in the four repositories mentioned above. 83 | 84 | #### Test case 85 | ```rust 86 | // 39 lines 32 code 2 comments 5 blanks 87 | 88 | /* /**/ */ 89 | fn main() { 90 | let start = "/*"; 91 | loop { 92 | if x.len() >= 2 && x[0] == '*' && x[1] == '/' { // found the */ 93 | break; 94 | } 95 | } 96 | } 97 | 98 | fn foo() { 99 | let this_ends = "a \"test/*."; 100 | call1(); 101 | call2(); 102 | let this_does_not = /* a /* nested */ comment " */ 103 | "*/another /*test 104 | call3(); 105 | */"; 106 | } 107 | 108 | fn foobar() { 109 | let does_not_start = // " 110 | "until here, 111 | test/* 112 | test"; // a quote: " 113 | let also_doesnt_start = /* " */ 114 | "until here, 115 | test,*/ 116 | test"; // another quote: " 117 | } 118 | 119 | fn foo() { 120 | let a = 4; // /* 121 | let b = 5; 122 | let c = 6; // */ 123 | } 124 | ``` 125 | 126 | ###### Tokei 127 | ``` 128 | ------------------------------------------------------------------------------- 129 | Language Files Lines Code Comments Blanks 130 | ------------------------------------------------------------------------------- 131 | Rust 1 39 32 2 5 132 | ------------------------------------------------------------------------------- 133 | ``` 134 | 135 | ###### Scc 136 | ``` 137 | ------------------------------------------------------------------------------- 138 | Language Files Lines Code Comments Blanks Complexity 139 | ------------------------------------------------------------------------------- 140 | Rust 1 34 28 1 5 5 141 | ------------------------------------------------------------------------------- 142 | ``` 143 | 144 | ###### Loc 145 | ``` 146 | -------------------------------------------------------------------------------- 147 | Language Files Lines Blank Comment Code 148 | -------------------------------------------------------------------------------- 149 | Rust 1 39 5 10 24 150 | -------------------------------------------------------------------------------- 151 | ``` 152 | 153 | ###### Cloc 154 | ``` 155 | ------------------------------------------------------------------------------- 156 | Language files blank comment code 157 | ------------------------------------------------------------------------------- 158 | Rust 1 5 10 24 159 | ------------------------------------------------------------------------------- 160 | ``` 161 | 162 | #### CPython 163 | 164 | ###### Tokei 165 | ``` 166 | -------------------------------------------------------------------------------- 167 | Language Files Lines Code Comments Blanks 168 | -------------------------------------------------------------------------------- 169 | Assembly 7 2134 1839 37 258 170 | Autoconf 12 4298 2581 893 824 171 | Batch 29 1750 1461 0 289 172 | C 318 401463 306070 45481 49912 173 | C Header 352 147814 123096 10189 14529 174 | C Shell 1 37 21 7 9 175 | C++ 5 4174 3181 262 731 176 | CSS 1 6 0 4 2 177 | D 5 82 73 1 8 178 | Fish 1 75 47 15 13 179 | HTML 9 1635 1538 0 97 180 | JavaScript 2 200 169 13 18 181 | Lisp 1 692 502 81 109 182 | Makefile 1 5 4 0 1 183 | Module-Definition 8 1385 1349 14 22 184 | MSBuild 9 900 744 72 84 185 | Objective C 7 794 635 61 98 186 | Prolog 1 24 24 0 0 187 | Python 1834 753782 590076 53996 109710 188 | ReStructuredText 984 289166 289166 0 0 189 | Shell 4 549 301 149 99 190 | SVG 8 11 9 0 2 191 | Plain Text 135 89183 89183 0 0 192 | VBScript 1 1 0 1 0 193 | XML 4 19 17 2 0 194 | -------------------------------------------------------------------------------- 195 | Total 3739 1700179 1412086 111278 176815 196 | -------------------------------------------------------------------------------- 197 | ``` 198 | 199 | ###### Scc 200 | ``` 201 | ------------------------------------------------------------------------------- 202 | Language Files Lines Code Comments Blanks Complexity 203 | ------------------------------------------------------------------------------- 204 | Python 1845 757463 592457 54831 110175 88978 205 | ReStructuredText 985 289233 204773 0 84460 0 206 | C Header 353 143235 122361 8571 12303 3980 207 | C 318 371150 292140 38196 40814 66793 208 | Plain Text 147 89284 86652 0 2632 0 209 | Batch 29 1750 1461 0 289 603 210 | YAML 13 852 734 0 118 0 211 | Autoconf 12 4298 2581 893 824 638 212 | HTML 10 1839 1736 3 100 0 213 | MSBuild 9 899 744 81 74 4 214 | Module-Definition 8 1385 1349 14 22 18 215 | SVG 8 11 9 0 2 0 216 | Objective C 7 789 635 57 97 71 217 | Assembly 7 2134 1839 37 258 28 218 | D 5 81 73 1 7 4 219 | XML 5 132 76 0 56 0 220 | License 5 346 281 0 65 0 221 | C++ 5 4169 3179 259 731 663 222 | ASP.NET 4 11 11 0 0 0 223 | Makefile 4 308 216 38 54 15 224 | m4 2 415 318 53 44 0 225 | JavaScript 2 200 169 13 18 21 226 | C Shell 1 37 21 7 9 13 227 | Prolog 1 24 24 0 0 0 228 | CSS 1 4 0 4 0 0 229 | IDL 1 12 11 0 1 0 230 | Fish 1 75 47 15 13 9 231 | Shell 1 172 109 23 40 7 232 | Patch 1 18 16 0 2 0 233 | Markdown 1 30 19 0 11 0 234 | CSV 1 345 345 0 0 0 235 | Lisp 1 692 502 81 109 0 236 | ------------------------------------------------------------------------------- 237 | Total 3793 1671393 1314888 103177 253328 161845 238 | ------------------------------------------------------------------------------- 239 | Estimated Cost to Develop $50,866,110 240 | Estimated Schedule Effort 68.286305 months 241 | Estimated People Required 88.236762 242 | ------------------------------------------------------------------------------- 243 | ``` 244 | 245 | ###### Loc 246 | ``` 247 | -------------------------------------------------------------------------------- 248 | Language Files Lines Blank Comment Code 249 | -------------------------------------------------------------------------------- 250 | Python 1843 753596 109682 60636 583278 251 | C 318 401463 49912 46468 305083 252 | reStructuredText 984 289166 84441 0 204725 253 | C/C++ Header 352 147814 14529 10007 123278 254 | Plain Text 147 89183 2619 0 86564 255 | C++ 5 4174 731 262 3181 256 | Makefile 5 2274 275 267 1732 257 | Assembly 7 2134 258 310 1566 258 | HTML 10 1635 97 0 1538 259 | Batch 29 1750 289 0 1461 260 | Autoconf 9 2200 575 636 989 261 | Objective-C 7 794 98 61 635 262 | Lisp 1 692 109 81 502 263 | JavaScript 2 200 18 13 169 264 | Bourne Shell 1 172 40 23 109 265 | INI 1 171 42 27 102 266 | D 5 82 8 1 73 267 | Prolog 1 24 0 0 24 268 | C Shell 1 37 9 7 21 269 | XML 5 19 0 2 17 270 | CSS 1 6 2 4 0 271 | -------------------------------------------------------------------------------- 272 | Total 3734 1697586 263734 118805 1315047 273 | -------------------------------------------------------------------------------- 274 | ``` 275 | 276 | ###### Cloc 277 | ``` 278 | github.com/AlDanial/cloc v 1.76 T=3.84 s (703.1 files/s, 352799.7 lines/s) 279 | --------------------------------------------------------------------------------------- 280 | Language files blank comment code 281 | --------------------------------------------------------------------------------------- 282 | Python 1810 110244 135433 512014 283 | C 318 49893 46475 305095 284 | C/C++ Header 353 14677 10288 123542 285 | Bourne Shell 13 2806 2403 17559 286 | m4 3 513 150 5322 287 | C++ 5 731 262 3181 288 | HTML 10 100 11 1736 289 | WiX source 51 159 39 1690 290 | Assembly 7 258 395 1481 291 | DOS Batch 29 289 87 1374 292 | Windows Module Definition 8 22 14 1349 293 | MSBuild script 27 44 4 679 294 | YAML 13 118 78 656 295 | Objective C 7 98 61 635 296 | Lisp 1 109 81 502 297 | Pascal 3 110 261 333 298 | Windows Resource File 7 40 47 289 299 | make 3 53 38 212 300 | WiX string localization 11 28 0 188 301 | JavaScript 2 18 13 169 302 | PowerShell 2 25 37 122 303 | INI 1 42 27 102 304 | XML 5 56 2 76 305 | D 5 8 1 73 306 | Fish Shell 1 13 15 47 307 | IDL 2 1 0 35 308 | C Shell 1 9 7 21 309 | Markdown 1 11 0 19 310 | CSS 1 2 4 0 311 | Visual Basic 1 0 1 0 312 | --------------------------------------------------------------------------------------- 313 | SUM: 2701 180477 196234 978501 314 | --------------------------------------------------------------------------------------- 315 | ``` 316 | 317 | #### Redis 318 | 319 | ###### Tokei 320 | ``` 321 | -------------------------------------------------------------------------------- 322 | Language Files Lines Code Comments Blanks 323 | -------------------------------------------------------------------------------- 324 | Autoconf 18 10821 8469 1326 1026 325 | Batch 1 28 26 0 2 326 | C 249 143671 103080 24170 16421 327 | C Header 199 27534 17960 6204 3370 328 | C++ 4 286 224 14 48 329 | C++ Header 1 9 5 3 1 330 | CSS 2 107 91 0 16 331 | HTML 5 9658 6721 9 2928 332 | Lua 19 414 306 53 55 333 | Makefile 9 1031 722 100 209 334 | Markdown 8 1886 1886 0 0 335 | Python 2 219 162 17 40 336 | Ruby 8 722 580 69 73 337 | Shell 40 1195 790 254 151 338 | TCL 98 16815 13861 982 1972 339 | Plain Text 1 23 23 0 0 340 | XSL 1 10 10 0 0 341 | YAML 1 36 28 4 4 342 | -------------------------------------------------------------------------------- 343 | Total 666 214465 154944 33205 26316 344 | -------------------------------------------------------------------------------- 345 | ``` 346 | 347 | ###### Scc 348 | ``` 349 | ------------------------------------------------------------------------------- 350 | Language Files Lines Code Comments Blanks Complexity 351 | ------------------------------------------------------------------------------- 352 | C 249 132592 100360 16629 15603 24928 353 | C Header 199 24522 16851 4606 3065 1514 354 | TCL 98 16815 13838 1005 1972 1605 355 | Shell 36 1100 706 253 141 135 356 | Lua 20 524 384 71 69 66 357 | Autoconf 18 10821 8469 1326 1026 965 358 | gitignore 11 151 135 0 16 0 359 | Makefile 9 1031 722 100 209 50 360 | Markdown 8 1886 1363 0 523 0 361 | Ruby 8 716 574 69 73 103 362 | C++ 5 310 244 15 51 31 363 | HTML 5 9647 6717 5 2925 0 364 | YAML 4 273 254 0 19 0 365 | License 3 66 55 0 11 0 366 | CSS 2 107 91 0 16 0 367 | Python 2 219 160 19 40 61 368 | Plain Text 1 23 16 0 7 0 369 | Batch 1 28 26 0 2 3 370 | Smarty Template 1 44 43 0 1 5 371 | C++ Header 1 9 5 3 1 0 372 | m4 1 562 393 53 116 0 373 | ------------------------------------------------------------------------------- 374 | Total 682 201446 151406 24154 25886 29466 375 | ------------------------------------------------------------------------------- 376 | Estimated Cost to Develop $5,257,091 377 | Estimated Schedule Effort 28.825317 months 378 | Estimated People Required 21.603600 379 | ------------------------------------------------------------------------------- 380 | ``` 381 | 382 | ###### Loc 383 | ``` 384 | -------------------------------------------------------------------------------- 385 | Language Files Lines Blank Comment Code 386 | -------------------------------------------------------------------------------- 387 | C 249 143671 16421 24255 102995 388 | C/C++ Header 200 27543 3371 6080 18092 389 | Tcl 98 16815 1972 1005 13838 390 | Autoconf 17 10252 966 1311 7975 391 | HTML 5 9658 2928 12 6718 392 | Markdown 8 1886 523 0 1363 393 | Makefile 10 1600 269 115 1216 394 | Bourne Shell 36 1103 141 253 709 395 | Ruby 8 722 73 69 580 396 | Lua 20 414 55 53 306 397 | C++ 4 286 48 14 224 398 | Python 2 219 40 19 160 399 | CSS 2 107 16 0 91 400 | YAML 1 36 4 4 28 401 | Batch 1 28 2 0 26 402 | Plain Text 1 23 7 0 16 403 | -------------------------------------------------------------------------------- 404 | Total 662 214363 26836 33190 154337 405 | -------------------------------------------------------------------------------- 406 | ``` 407 | 408 | ###### Cloc 409 | ``` 410 | github.com/AlDanial/cloc v 1.76 T=1.12 s (585.8 files/s, 200325.9 lines/s) 411 | -------------------------------------------------------------------------------- 412 | Language files blank comment code 413 | -------------------------------------------------------------------------------- 414 | C 248 16420 24255 102995 415 | C/C++ Header 200 3369 6080 18094 416 | Bourne Shell 42 2398 1488 14556 417 | Tcl/Tk 98 1972 1002 13841 418 | HTML 5 2928 12 6718 419 | m4 2 279 147 2430 420 | Markdown 7 459 0 1203 421 | make 9 209 100 722 422 | Ruby 8 73 67 582 423 | Lua 20 69 71 385 424 | YAML 4 19 4 250 425 | C++ 5 51 16 244 426 | Python 2 40 52 127 427 | CSS 2 16 0 91 428 | Bourne Again Shell 1 13 4 85 429 | DOS Batch 1 2 0 26 430 | XSLT 1 0 0 10 431 | -------------------------------------------------------------------------------- 432 | SUM: 655 28317 33298 162359 433 | -------------------------------------------------------------------------------- 434 | ``` 435 | 436 | #### Rust 437 | 438 | ###### Tokei 439 | ``` 440 | -------------------------------------------------------------------------------- 441 | Language Files Lines Code Comments Blanks 442 | -------------------------------------------------------------------------------- 443 | Assembly 1 3 3 0 0 444 | Autoconf 1 96 74 9 13 445 | Batch 2 19 6 9 4 446 | C 45 1307 800 336 171 447 | C Header 2 236 195 20 21 448 | C++ 8 3298 2615 269 414 449 | CSS 6 2714 2229 88 397 450 | Dockerfile 49 1955 1419 163 373 451 | Happy 1 1992 1753 0 239 452 | JavaScript 29 3325 2552 457 316 453 | JSON 27 3921 3921 0 0 454 | Makefile 196 2931 2152 335 444 455 | Markdown 191 19588 19588 0 0 456 | Python 24 6104 4618 453 1033 457 | Rust 10938 972528 597964 255211 119353 458 | Shell 60 2901 1716 823 362 459 | SVG 2 2 2 0 0 460 | Plain Text 15 715 715 0 0 461 | TOML 71 1416 1140 104 172 462 | XSL 2 58 44 8 6 463 | XML 1 88 77 11 0 464 | YAML 1 268 171 72 25 465 | -------------------------------------------------------------------------------- 466 | Total 11672 1025465 643754 258368 123343 467 | -------------------------------------------------------------------------------- 468 | ``` 469 | 470 | ###### Scc 471 | ``` 472 | ------------------------------------------------------------------------------- 473 | Language Files Lines Code Comments Blanks Complexity 474 | ------------------------------------------------------------------------------- 475 | Rust 10937 971395 595420 257017 118958 44656 476 | Makefile 196 2931 2152 335 444 120 477 | Markdown 191 19588 15748 0 3840 0 478 | TOML 71 1416 1140 104 172 1 479 | Shell 55 2764 1641 783 340 102 480 | Dockerfile 49 1955 1419 163 373 107 481 | C 45 1306 800 336 170 157 482 | JavaScript 29 3317 2552 453 312 566 483 | JSON 27 3921 3921 0 0 0 484 | Python 23 6082 4581 474 1027 1206 485 | Plain Text 15 715 578 0 137 0 486 | Puppet 10 360 305 7 48 2 487 | ASP.NET 8 45 45 0 0 2 488 | C++ 8 3296 2616 266 414 188 489 | CSS 6 2684 2227 73 384 0 490 | gitignore 5 117 115 0 2 0 491 | Patch 4 137 124 0 13 0 492 | Batch 2 19 6 9 4 1 493 | C Header 2 236 195 20 21 10 494 | YAML 2 664 609 0 55 0 495 | SVG 2 2 2 0 0 0 496 | License 2 695 570 0 125 0 497 | Autoconf 1 96 74 9 13 0 498 | Assembly 1 3 3 0 0 0 499 | LEX 1 360 322 0 38 0 500 | Happy 1 1992 1753 0 239 0 501 | XML 1 80 77 3 0 0 502 | ------------------------------------------------------------------------------- 503 | Total 11694 1026176 638995 260052 127129 47118 504 | ------------------------------------------------------------------------------- 505 | Estimated Cost to Develop $23,843,371 506 | Estimated Schedule Effort 51.202420 months 507 | Estimated People Required 55.160961 508 | ------------------------------------------------------------------------------- 509 | ``` 510 | 511 | ###### Loc 512 | ``` 513 | -------------------------------------------------------------------------------- 514 | Language Files Lines Blank Comment Code 515 | -------------------------------------------------------------------------------- 516 | Rust 10938 972528 119353 257285 595890 517 | Markdown 191 19588 3840 0 15748 518 | Python 23 6085 1029 630 4426 519 | JSON 27 3921 0 0 3921 520 | C++ 8 3298 414 268 2616 521 | JavaScript 29 3325 316 457 2552 522 | Makefile 199 3041 461 344 2236 523 | CSS 6 2714 397 87 2230 524 | Bourne Shell 55 2766 341 783 1642 525 | Yacc 1 1992 239 135 1618 526 | Toml 71 1416 172 104 1140 527 | C 45 1307 171 336 800 528 | Plain Text 15 715 137 0 578 529 | C/C++ Header 2 236 21 20 195 530 | YAML 1 268 25 72 171 531 | XML 1 88 0 11 77 532 | Batch 2 19 4 9 6 533 | Assembly 1 3 0 0 3 534 | -------------------------------------------------------------------------------- 535 | Total 11615 1023310 126920 260541 635849 536 | -------------------------------------------------------------------------------- 537 | ``` 538 | 539 | ###### Cloc 540 | ``` 541 | github.com/AlDanial/cloc v 1.76 T=7.85 s (1466.7 files/s, 130415.4 lines/s) 542 | ----------------------------------------------------------------------------------- 543 | Language files blank comment code 544 | ----------------------------------------------------------------------------------- 545 | Rust 10788 118944 255512 595199 546 | Markdown 191 3840 0 15748 547 | Python 24 1033 1126 3945 548 | JSON 27 0 0 3921 549 | C++ 8 413 268 2617 550 | JavaScript 28 314 448 2546 551 | CSS 6 397 87 2230 552 | make 192 440 335 2131 553 | Bourne Shell 58 359 762 1730 554 | yacc 1 239 135 1618 555 | Dockerfile 49 373 163 1419 556 | TOML 71 172 104 1140 557 | C 40 169 323 788 558 | YAML 2 55 113 496 559 | WiX source 3 42 30 361 560 | lex 1 38 0 322 561 | C/C++ Header 2 21 20 195 562 | Puppet 7 43 82 166 563 | XML 1 0 11 77 564 | XSLT 2 6 8 44 565 | Windows Resource File 3 14 31 19 566 | DOS Batch 2 4 9 6 567 | Assembly 1 0 0 3 568 | ----------------------------------------------------------------------------------- 569 | SUM: 11507 126916 259567 636721 570 | ----------------------------------------------------------------------------------- 571 | ``` 572 | 573 | #### Unreal Engine 574 | 575 | ###### Tokei 576 | ``` 577 | -------------------------------------------------------------------------------- 578 | Language Files Lines Code Comments Blanks 579 | -------------------------------------------------------------------------------- 580 | ASP.NET 12 12737 2248 8556 1933 581 | Autoconf 185 126415 105366 9171 11878 582 | BASH 2 354 280 38 36 583 | Batch 217 6794 4863 525 1406 584 | C 3928 1730150 1110011 356089 264050 585 | C Header 38707 8614972 5067244 2317451 1230277 586 | CMake 1378 137324 83976 36494 16854 587 | C# 1799 489470 362137 72312 55021 588 | C++ 14789 6617808 4855563 638643 1123602 589 | C++ Header 6863 1446785 1029508 218492 198785 590 | CSS 28 24345 21413 537 2395 591 | HTML 1053 154367 143718 1630 9019 592 | Java 98 23089 16223 4101 2765 593 | JavaScript 222 90698 71561 10287 8850 594 | JSON 142 71356 71356 0 0 595 | Makefile 360 24610 12696 7264 4650 596 | Markdown 78 14774 14774 0 0 597 | Module-Definition 165 27216 24434 453 2329 598 | MSBuild 95 11785 11316 463 6 599 | Objective C 325 78887 53269 14421 11197 600 | Objective C++ 139 41798 30898 4430 6470 601 | Perl 44 9033 6505 1193 1335 602 | Python 3775 1237391 947198 103874 186319 603 | Shell 386 153390 116471 19913 17006 604 | Plain Text 4307 3260946 3260946 0 0 605 | XAML 9 2256 2061 82 113 606 | XML 639 134161 129186 2503 2472 607 | -------------------------------------------------------------------------------- 608 | Total 79745 24542911 17555221 3828922 3158768 609 | -------------------------------------------------------------------------------- 610 | ``` 611 | 612 | ###### Scc 613 | ``` 614 | ------------------------------------------------------------------------------- 615 | Language Files Lines Code Comments Blanks Complexity 616 | ------------------------------------------------------------------------------- 617 | C Header 38740 8152989 4993858 2013293 1145838 186799 618 | C++ 14801 6555240 4834555 628656 1092029 723818 619 | C++ Header 6926 1439558 1013892 238746 186920 70952 620 | Plain Text 4369 3265607 3184635 0 80972 0 621 | C 3968 1519740 1079896 215851 223993 235498 622 | Python 3823 1258597 961660 108034 188903 178928 623 | C# 1790 495297 363280 76586 55431 40223 624 | CMake 1395 137792 83799 37093 16900 8172 625 | HTML 1065 179304 155477 13501 10326 0 626 | XML 641 149271 145848 989 2434 0 627 | Makefile 378 26797 13825 7874 5098 818 628 | Objective C 325 76867 53170 12748 10949 6074 629 | Shell 238 152504 110731 24819 16954 18967 630 | JavaScript 222 89613 70526 10684 8403 26425 631 | Batch 218 6798 4866 525 1407 782 632 | Autoconf 185 126415 105366 9171 11878 16329 633 | Module-Definition 165 27216 24434 453 2329 420 634 | JSON 146 71515 71468 0 47 0 635 | Objective C++ 139 41120 30879 3816 6425 2290 636 | Java 98 22476 16214 3577 2685 2000 637 | MSBuild 95 11712 11277 430 5 0 638 | Markdown 78 14774 11210 0 3564 0 639 | XCode Config 64 2354 317 1764 273 0 640 | License 57 4943 4160 0 783 0 641 | Perl 44 9031 6421 1275 1335 1005 642 | CSS 28 23900 21330 321 2249 0 643 | Expect 19 2269 2170 46 53 2 644 | gitignore 14 510 401 61 48 0 645 | ASP.NET 12 12653 2248 10038 367 266 646 | XAML 9 2200 2064 39 97 0 647 | XML Schema 2 4 4 0 0 0 648 | ------------------------------------------------------------------------------- 649 | Total 80054 23879066 17379981 3420390 3078695 1519768 650 | ------------------------------------------------------------------------------- 651 | Estimated Cost to Develop $764,974,728 652 | Estimated Schedule Effort 191.283130 months 653 | Estimated People Required 473.723654 654 | ------------------------------------------------------------------------------- 655 | ``` 656 | 657 | ###### Loc 658 | ``` 659 | -------------------------------------------------------------------------------- 660 | Language Files Lines Blank Comment Code 661 | -------------------------------------------------------------------------------- 662 | C/C++ Header 45595 9974068 1416252 2524523 6033293 663 | C++ 14801 6617808 1123602 641666 4852540 664 | Plain Text 4643 3284144 82784 0 3201360 665 | C 3958 1730150 264050 349650 1116450 666 | Python 3823 1236825 186229 120015 930581 667 | C# 1809 486880 54678 75623 356579 668 | HTML 1065 154367 9019 1647 143701 669 | Makefile 797 171037 19979 20166 130892 670 | XML 640 134161 2472 2523 129166 671 | Bourne Shell 238 152708 16982 24827 110899 672 | JSON 142 71356 47 0 71309 673 | JavaScript 222 90698 8850 11124 70724 674 | Objective-C 325 78887 11197 14417 53273 675 | Objective-C++ 139 41798 6470 4986 30342 676 | CSS 28 24345 2395 537 21413 677 | Java 98 23089 2765 4152 16172 678 | Markdown 78 14774 3564 0 11210 679 | INI 269 13472 1766 720 10986 680 | Perl 43 9026 1334 1275 6417 681 | Batch 217 6794 1406 467 4921 682 | ASP.NET 12 12737 1933 8580 2224 683 | -------------------------------------------------------------------------------- 684 | Total 78942 24329124 3217774 3806898 17304452 685 | -------------------------------------------------------------------------------- 686 | ``` 687 | 688 | ###### Cloc 689 | ``` 690 | github.com/AlDanial/cloc v 1.76 T=61.98 s (964.6 files/s, 288865.7 lines/s) 691 | --------------------------------------------------------------------------------------- 692 | Language files blank comment code 693 | --------------------------------------------------------------------------------------- 694 | C++ 13439 1050589 581040 4631284 695 | C/C++ Header 31672 1047219 1750961 4399521 696 | C 3922 264936 350701 1121458 697 | Python 3165 172022 226580 732442 698 | C# 1749 52489 76609 334906 699 | HTML 1031 10116 1985 162198 700 | XML 618 2401 2285 140406 701 | MSBuild script 198 6 481 111352 702 | CMake 1350 16535 36540 81666 703 | JavaScript 213 8772 11060 67595 704 | Bourne Shell 298 9876 13933 62513 705 | Objective C 325 11197 14417 53273 706 | JSON 134 41 0 51854 707 | Objective C++ 117 5529 3857 27409 708 | INI 256 5218 935 24151 709 | CSS 24 2210 483 20619 710 | Windows Module Definition 136 1934 395 20206 711 | make 518 6584 9626 19298 712 | Java 98 2765 4100 16224 713 | Markdown 75 3424 0 10814 714 | Pascal 20 662 5900 6597 715 | Perl 42 1330 1211 6429 716 | HLSL 60 1229 631 5265 717 | DOS Batch 198 1380 700 4482 718 | Windows Resource File 62 1023 1368 3754 719 | ASP.NET 7 538 7 2687 720 | GLSL 10 558 482 2445 721 | XAML 9 113 82 2061 722 | Expect 17 51 46 1368 723 | Smalltalk 13 117 7 887 724 | Ant 3 44 167 407 725 | Bourne Again Shell 4 49 78 305 726 | SAS 1 14 22 32 727 | --------------------------------------------------------------------------------------- 728 | SUM: 59784 2680971 3096689 12125908 729 | --------------------------------------------------------------------------------------- 730 | ``` 731 | 732 | ## Related Reading 733 | 734 | * ["Sloc Cloc and Code - What happened on the way to faster Cloc"](https://boyter.org/posts/sloc-cloc-code/) by [Ben Boyter](https://github.com/boyter) 735 | * ["Why count lines of code?"](https://boyter.org/posts/why-count-lines-of-code/) by [Ben Boyter](https://github.com/boyter) 736 | 737 | 738 | [Unreal]: https://github.com/EpicGames/UnrealEngine 739 | [Rust]: https://github.com/rust-lang/rust 740 | [CPython]: https://github.com/python/cpython 741 | [Redis]: https://github.com/antirez/redis 742 | [hyperfine]: https://github.com/sharkdp/hyperfine 743 | --------------------------------------------------------------------------------