Lines of Code counter - include tokei.toml configuration file?

Currently the lines of code counter counts docstrings in certain languages such as python and julia as code. See XAMPPRocky/tokei#763 (julia), XAMPPRocky/tokei#413 (python - there are other issue #s)

This can be solved by including a simple tokei.toml file that has a count docstrings as comments setting:

# Any doc strings (e.g. `"""hello"""` in python) will be counted as comments.
treat_doc_strings_as_comments = true 

This is the tokei canonical way to change the default configuration. See the readme section on configuration

I don’t think this will help clojure - see XAMPPRocky/tokei#229 and I don’t know whether this issue exists for other languages, but this is an official tokei setting that could be useful.

There are many python exercises that have docstrings in the stub file - useful so that you don’t have to keep switching to the readme. The current situation makes a solution that kept the exercism docstring comments seem much longer than one where the user deleted those docstrings. I think docstrings are useful.

This fix could be implemented by putting a line in the dockerfile to copy over a simple tokei.toml file as above into the directory from which tokei is run (the working directory?)

1 Like

(cc @ErikSchierboom)

PR opened: Don't count docstrings as code by ErikSchierboom · Pull Request #108 · exercism/lines-of-code-counter · GitHub

The lines of code counter is updated. All Julia submissions have been re-processed and the Python ones are queued.


This is awesome to see. I loved watching how this change was propagated. Thank you.