Commit graph

277 commits

Author SHA1 Message Date
Aaron Power 553736fe8f Fixed minor parser inaccuracies 2018-01-26 13:17:55 +00:00
Igor Gnatenko 471585537c fix build with features enabled (#178)
Since 8817762d7b, build fails with any
features enabled..

error[E0308]: mismatched types
  --> src/main.rs:95:30
   |
95 |         match_output(format, &languages);
   |                              ^^^^^^^^^^
   |                              |
   |                              expected struct `tokei::Languages`, found reference
   |                              help: consider removing the borrow: `languages`
   |
   = note: expected type `tokei::Languages`
              found type `&tokei::Languages`

Problem is that when no features enabled, match_output() doesn't need
to "eat" `tokei::Languages`, but in real version of match_output it
must not be borrowed.

Fixes: https://github.com/Aaronepower/tokei/issues/177
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-01-19 14:55:56 +00:00
Aaron Power 77380bc4b2 Version 7
* Fixed parsing corner cases
* Changed storage of comments and quotes from `Vec` to static slices.
* Added tracing for debugging single files. Not recommended for use on
multiple files
* Updated log
2018-01-15 01:42:39 +00:00
Aaron Power 8817762d7b Updated log, made changes recommended by clippy 2018-01-13 17:45:11 +00:00
Aaron Power 14f05734b4 Updated log 2018-01-06 19:06:20 +00:00
Igor Gnatenko 46ee5ff92f Bump serde_cbor to 0.8 (#167)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-01-01 22:53:59 +00:00
Igor Gnatenko c3b6fd7b77 bump ignore to 0.3, rayon to 0.9, handlebars to 0.29, hex to 0.3 (#158)
* bump ignore to 0.3

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>

* bump rayon to 0.9

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>

* bump handlebars to 0.29

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>

* bump hex to 0.3

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>

* bump lazy_static to 1

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-12-02 14:59:44 +00:00
equal-l2 78112951ae Use eprintln! (#147)
eprint! and eprintln! has been introduced on Rust 1.19.0
They provides same functionalities as err! and errln!
2017-09-30 16:25:26 +01:00
Aaron Power 9132112f1b Removed extra debug println 2017-09-03 23:08:09 +01:00
Aaron Power 37e0824cf7 Fixes #138, updated Cargo.lock 2017-08-31 20:11:00 +01:00
Aaron Power 2f1b452c98 Switched if cases for better performance 2017-08-17 20:31:57 +01:00
Aaron Power f53c796f27 Changed how tokei searches through files.
Updated dependencies
Changed languages.json formatting
2017-08-11 00:07:58 +01:00
Aaron Power 3b5aea4b91 Fixed #134, updated dependencies, clarified errors
Fixed an issue where if the ending comment was shorter than the starting
multi line comment the endding comment would be ignored.
2017-07-27 17:00:57 +01:00
James Gilles 7849edfa34 Support "filenames" key, mk. 2 (#115)
* Support "filenames" key for Makefile-style languages

* Remove debugging statement

* Add CMake

* Cleaner docs and tests

* Add scons, handle languages with no extensions
2017-06-05 15:28:52 +01:00
m1el fd37e940a0 Allow multiple --exclude options (#114)
* Allow multiple --exclude options

* specify number_of_values so that --exclude consumes at most one argument
2017-03-28 21:03:49 +01:00
Aaron Power 2ac6693ca1 updated cargo.lock and changed trim 2017-03-28 21:00:48 +01:00
Aaron Power d3dc298708 Updated to use serde_derive, better tests, now uses macro for cli, updated dependencies 2017-02-15 19:42:08 +00:00
m1el b20e410a72 fixed --languages option always conflicting with input (#96)
* fixed `--languages` option always conflicting with input

As defined in `cli.yml`, `--languages` conflicts with `<input>`,
but if `<input>` has default value, `--languages` will always conflict,
even if no inputs were specified.

Computation of the default value for `<input>` is now moved to `src/main.rs`,
because it cannot be specified in `cli.yml` along with `--languages`.

I suspect this bug was introduced in commit b7a892f475, when default
value for `<input>` was added.

* input option is now optional in cli.yml
2017-01-18 14:16:14 +00:00
Aaron Power b7a892f475 v5.0.6: Updated dependencies, fixed exclude bug, and now defaults to
running the current directory over failing.
2017-01-15 00:22:28 +00:00
Aaron Power f6871e101c fixed json test 2017-01-03 14:38:38 +00:00
Aaron Power 229f2a34af fixed features 2017-01-03 00:28:27 +00:00
Aaron Power c08f113c2d version 5: optimised stats, language generation 2017-01-03 00:02:18 +00:00
Aaron Power 5c11e76c88 Updated dependencies, changed some unwraps with expect, and made
build process drier
2016-12-08 23:31:35 +00:00
Aaron Power ca9d1926fe Fixed serialisation features 2016-12-03 13:22:56 +00:00
Aaron Power bf304dd8eb Fix for languages with no single line comments panicing 2016-11-27 18:13:30 +00:00
Aaron Power f732e7cb0d Implemented fix for Sender never dropping Special thanks to: mbrubeck 2016-11-27 17:54:08 +00:00
Aaron Power 913752de0c Switched to using ignore, more parallelisation 2016-11-27 15:57:22 +00:00
Aaronepower a72121f67b Added heuristics 2016-11-26 16:33:28 +00:00
Łukasz Jan Niemier 04f6e1e3e4 Add Elixir support (#78) 2016-11-26 15:36:15 +00:00
Michael Bryan ed4f89816d Exit gracefully instead of panicking when using a feature that isn't compiled in (#77)
* fix: Exit gracefully instead of panicking when trying to use features

* removed an unnecessary empty line

* Added logging of any errors encountered writing to stderr.
2016-11-26 14:19:52 +00:00
Mack Stump 24fec6788f Only add regular files to path list (#75)
* only add regular files to path list

This fixes multiple issues. Before this commit, a directory with
a known file extension in its name would be added to the list of
"files" to open and read from. Another issue occurred with broken
symbolic links being added to the files list.

* add test to ensure directories not treated as file

* replace `unwrap()` with `rs_error!`
2016-11-15 22:09:10 +00:00
Aaronepower 5fab02a76d Simplified language definitions. 2016-10-27 00:55:22 +01:00
not-fl3 94ac1f6f2c Added support for elm (#71) 2016-10-15 16:32:35 +00:00
Sven-Hendrik Haase d98133347e Added GLSL support (#72) 2016-10-15 15:47:59 +00:00
Gabriel Ebner 9faa8d4210 Add support for lean, and fixed single comment regression (#70)
* Add Lean

* Handle single-line comments inside multi-line ones.
2016-09-29 23:42:31 +01:00
Aaron Power 5ced28ab86 fixed regression where lines and files weren't being sorted 2016-09-26 14:57:25 +01:00
llogiq 2fffe17787 pulled two if statements together and removed one needless reference (#69) 2016-09-22 18:59:13 +01:00
Xavier Payn 0b7a2493b6 add .pm to Perl extensions (#66) 2016-09-21 10:18:52 +01:00
Corentin Henry c9ca419b71 support tcl (#64) 2016-09-21 01:44:07 +01:00
Aaronepower 1839132aa5 Changed logging behaviour based on feedback. 2016-09-20 22:26:25 +01:00
Aaronepower 2e5c46d71a Enabled logging, using log & env_logger. Fixes #54 2016-09-20 21:49:47 +01:00
Aaronepower 9ec7499a2d Added encoding dependency, so now tokei can handle all files that encoding supports, fixes #53 2016-09-17 22:45:37 +01:00
Matthew Williamson 3f5fb6ca11 Fixes issue #52 (#61)
Modification on comments:
Batch - Add ::
Lisp - Comments can be nested (www.rosettacode.org/wiki/Comments#Common_Lisp)
Python - Reverted to hash, based on comment thread from pull #59 as
string has a return value

Changes to the quotes
Assembly - Uses ' ' or " "
Bash - Uses ' ' or " "
Batch - They don't use quotes for strings
Cold Fusion - Uses ' ' or " "
D - Uses " " or
Dart - Uses " " or ' ' or """ """ or ''' '''
Forth - Uses " " but new, doesn't have a preset
Fortrans - Use " " or ' '
Idris - Uses " " or """ """
Julia - Uses " " or """ """
Kotlin - Uses " " or """ """
Moustache - Uses " " or ' '
Nim - Uses " " or """ """
Pascal - Uses ' '
Perl - Uses " " or ' '
Php - Uses " " or ' '
Python - Uses " " or ' ' or """ """ or ''' '''
Ruby - Uses " " or ' '
Sass - Uses " " or ' '
Sql - Uses ' '
Toml - Uses " " or ' ' or """ """ or ''' '''
Typescript - Uses " " or ' ' or
Vimscript - Uses " " or ' '
Yaml - Uses " " or ' '
Zsh - Uses " " or ' '
2016-09-11 12:15:29 +01:00
Matthew Williamson d13af4d177 Made a series of modifications to the languages comments: (#59)
* Made a series of modifications to the comments:

	Clojure - Removed #
	Forth   - ( Comment) style comments need a space after the opening paren
	Haskell - Has nested comments
        Idris - Has nested comments
	Jai     - Has nested block comments
	Julia   - Has nested block comments
	Kotlin  - Has nested block comments
	Pascal  - Pascal should be multiline from { or (* to } or *)
	Perl    - Perl5 and earlier for multiline comments need =pod to =cut.
	Python  - Python can use """ or ''' for comments
	Swift   - Has nested block comments
2016-09-10 18:57:43 +01:00
Aaronepower 0da50fc544 fixes #58 2016-09-10 11:11:28 +01:00
Aaron Power dc1fe7bf1f Support lossy over strict utf8 2016-09-09 14:34:42 +01:00
Liigo Zhuang df2689a2d5 Avoid panicking on non-character-boundary inside string slice (#56)
Fixes #55
2016-09-09 07:38:59 +01:00
Aaronepower bfc80d5b69 fixed regression, moved to tempdir for testing. 2016-09-08 20:52:11 +01:00
Aaron Power e2b7328275 add hex ihex rst 2016-08-30 17:54:45 +01:00
Aaron Power 88bc1935c8 Added Asp, Asp.NET, Assmebly extension, Razor 2016-08-23 09:10:50 +01:00
Aaronepower 68c62f8dc2 4.2.0 fixes #51 2016-08-21 20:24:00 +01:00
Aaron Power e1a4529e2d Implmented stack based functionality 2016-08-16 17:35:22 +01:00
Aaronepower e2d3de4a2e half completed rework of handling multilines 2016-08-16 00:34:58 +01:00
Aaron Power d5fa7da937 Version 4.1.0 2016-08-08 09:18:32 +01:00
Aaronepower 87a7b44af5 Increased stack size for builds 2016-08-01 14:01:12 +01:00
Aaronepower 2d7829c956 fixed build issue on main 2016-08-01 12:48:46 +01:00
Aaronepower e4435402de Minimal version 2016-08-01 12:11:40 +01:00
Aaronepower b2790c4eee Weird trait problem 2016-08-01 09:53:09 +01:00
Aaronepower c0c916beab unfisnished move 2016-07-23 14:47:41 +01:00
Aaronepower bfbfaa60fc First draft 2016-07-17 22:17:49 +01:00
Aaronepower 4e671b5fa9 removed syntex used new serde build process 2016-06-12 18:27:05 +01:00
Aaronepower a2bf592ff6 version 3.0.1 updated dependencies 2016-06-12 15:27:32 +01:00
Aaronepower b46bf60ab8 Fixed tests 2016-06-10 22:33:27 +01:00
Aaronepower 9a3dbf1a4a added documentation 2016-06-09 15:35:11 +01:00
Aaronepower b48de870d6 removed print from language 2016-06-07 14:08:28 +01:00
Aaronepower 4f6cf406e7 forgot files 2016-06-07 12:09:38 +01:00
Aaronepower 1e6a4c1015 feature parity 2016-06-07 12:09:22 +01:00
Aaronepower 76be54b67d first attempt at moving stuff around 2016-06-01 15:08:36 +01:00
Aaronepower 5ecad644f4 Re ordering the files 2016-05-29 20:31:57 +01:00
Phlosioneer 33395b9c56 Fixed parameter count mismatch.
Tests weren't updated to include the correct number of parameters when has_trailing_comments was updated (c5750f9).
nested=true uses the original, pre-change codepath for the tests.
2016-05-26 14:08:22 -04:00
Aaronepower f65a8c9825 fixes #39 2016-05-22 19:47:17 +01:00
Aaronepower c5750f9911 fixed tests 2016-05-22 18:43:42 +01:00
Aaron Power 350cb5f30f 2.1.0 IO 2016-05-22 18:07:16 +01:00
Aaronepower bc83358d82 ICE error 2016-05-20 12:44:24 +01:00
Aaronepower 77c52b4aea fixed miscounting total files 2016-05-17 11:27:03 +01:00
Aaronepower a126328d2e Merge branch 'master' into io 2016-05-17 11:24:47 +01:00
Aaronepower ee14e7ed5c resolved conflict 2016-05-17 11:24:31 +01:00
Aaronepower ff5db0626d change language.total, to something more descriptive 2016-05-17 11:23:44 +01:00
Aaronepower 43ea4d4256 reformatted cli.yml, and added additional constructor 2016-05-17 11:15:51 +01:00
Liigo 315f0882d1 Prints code lines before comments and blanks 2016-05-17 15:26:50 +08:00
Andre Bogus 945ec91484 another two clippy warnings 2016-05-15 13:36:44 +02:00
Aaronepower 8c6b6f28b2 forgot file 2016-05-13 22:16:20 +01:00
Aaronepower 0287ab0946 version 2.0 2016-05-13 22:16:05 +01:00
Aaronepower ebee004a8f moved functions to fsutil, and switched from RefCell to an Enum based system 2016-05-12 15:58:03 +01:00
Aaronepower db2060e0f2 fixed unused import 2016-05-01 18:36:37 +01:00
Aaronepower c28bfa8e9e implemented file counting. 2016-05-01 18:33:46 +01:00
Aaronepower e0fa667f8f Merge branch 'master' of github.com:Aaronepower/tokei 2016-03-29 14:39:03 +01:00
Aaronepower 2a97d41c20 Added .markdown, reduced runtime borrows, fixed 25 2016-03-29 14:38:58 +01:00
Hideo Hattori e827aaf15a support .zsh 2016-03-29 12:19:22 +09:00
Hideo Hattori 4f88d5dabf Merge branch 'master' into support-more-language 2016-03-29 11:55:11 +09:00
Hideo Hattori 2aefa97a3c support protocol buffers file 2016-03-29 11:54:53 +09:00
Aaron Power 116dfe7f16 Merge pull request #24 from hhatto/support-mustache
supported mustache file
2016-03-28 11:27:42 +01:00
Hideo Hattori bb593b6271 supported mustache file 2016-03-28 17:51:18 +09:00
Hideo Hattori 7738a67771 fixed skipped Makefile 2016-03-28 12:45:16 +09:00
Andre Bogus a8fce7c33e fixed some clippy warnings 2016-03-27 00:06:30 +01:00
Aaronepower db71efadc0 Added shebang support, added Assembly, Plain Text, LD Scripts, Makefiles, C Shell, and Device Trees 2016-03-25 14:41:11 +00:00
Aaronepower 8d7496905b changed formatting 2016-03-20 19:37:53 +00:00
Aaronepower 2cc84717de version bump, added polly, now using walkdir 2016-02-24 00:57:11 +00:00
Aaronepower 73b51b763e resloved merge conflict 2016-02-03 16:19:36 +00:00
Aaronepower 0a03887a34 made the main.rs file more ergonomic, used btreemap litreal, and updated to clap 2.0 2016-02-03 16:15:52 +00:00
Guillaume Fraux 7dd3d2de3a Add .hxx extension for C++ header 2016-01-29 10:55:04 +01:00
Guillaume Fraux 1077b5ca23 Add Lua language 2016-01-29 10:54:06 +01:00
Aaronepower c4889327f8 reimplemented comment syntax again, added OCaml, and Standard ML 2016-01-26 20:23:21 +00:00
Aaronepower 3293a7195a reimplemented multi line comment detection, and updated the readme to include cargo install 2016-01-24 17:11:39 +00:00
Aaronepower 5a2ed87863 added files flag fixes: #19 2015-11-26 22:32:13 +00:00
Luthaf 1817de1585 More modern fortran extensions 2015-10-30 21:35:38 +01:00
Aaronepower 93c7b9663c Updated Readme.md 2015-10-27 10:05:06 +00:00
Aaronepower 60062fa010 Added metadata, and added jai, and TeX as supported languages 2015-10-27 08:33:42 +00:00
Aaron Power 0d116dcccb Version bump, and fixed formatting 2015-10-25 07:39:12 +00:00
Aaronepower ee4712be1d fixed formatting 2015-10-11 21:48:20 +01:00
Aaronepower 770590c1ad fixed RefCell borrow 2015-10-11 21:45:36 +01:00
Aaron Power 42b98ccc2b fixed merge 2015-10-11 19:37:57 +01:00
Aaron Power eb806c9017 added support for multiple extensions 2015-10-11 10:37:13 +01:00
Aaron Power 1481e27bd2 made it faster? 2015-10-02 10:35:13 +01:00
Aaron Power d4e29df555 Added coveralls 2015-09-29 17:59:17 +01:00
Aaron Power 401885ea5d Fixes #13 2015-09-23 11:28:05 +01:00
Aaron Power 5c7abe0633 Added TOML, and MD, and removed rest args for exclude Fixes #11 #12 #13 2015-09-22 16:47:54 +01:00
PhnxRbrn 0d84ae01b2 Added copyright and contributors 2015-09-21 17:51:42 -05:00
Aaron Power b5ccff6d37 VERSION 1.1
- Added possible values for `--sort` `[files, total, blanks, code, comments]`

- Added support for the following languages
  - FORTRAN Legacy
  - FORTRAN Modern
  - Julia
2015-09-21 20:49:50 +01:00
PhnxRbrn f32fa88ea2 Fixed E0106 error on windows
Changed row from const to static and moved outside main function to be global to address error
2015-09-21 15:06:28 -05:00
Aaron Power 077e7075ca Fixed FORTRAN Modern comments Fixes #2 2015-09-21 11:50:22 +01:00
Aaron Power 4ff812ea7f Added FORTRAN support Fixes #2 2015-09-21 11:30:46 +01:00
Luthaf fc105545f1 Add Julia language
See: http://julialang.org/. The file extension is `.jl`, single line comments starts with `#` and multi-line comments are enclosed by `#=` and `=#`.
2015-09-21 12:03:19 +02:00
Aaron Power 3bbc39f937 VERSION 1.1, added sorting, added support for 26 languages, replaced getopts with clap 2015-09-20 10:40:07 +01:00
Aaronepower ee045d302c Cleaned up the code. 2015-07-01 13:46:52 +01:00
Aaronepower 73c666a7f6 Removed test folder structure 2015-05-26 22:03:08 +01:00
Aaronepower dbd679fa2a First draft of Rusty CLOC 2015-05-26 22:00:12 +01:00