NMarkgraf / RmdStyleChecker

Python script to check styling guidelines for R markdown documents.
0 stars 0 forks source link

List of style checks? #1

Open sebastiansauer opened 6 years ago

sebastiansauer commented 6 years ago

Hi @NMarkgraf,

great idea. Could you please provide a list/docu file of the checks that are being conducted? Those unlucky beings who are unfluent in Python will reside in thankfulness 😄

NMarkgraf commented 6 years ago

You are right! - This definitely needs a written style guide, so anybody will know what is checked by this tool.

I put that on my list. - But currently only blank lines before "#" und "##" are checked an unnecessary whitespaces at the end of a line.

Nothing is changes in the document, so this is more or less just a tool that warns you.

Also I know, there should be unit tests and some examples. - But, currently the weather is fine and the garden need some work and ...

If you like to try it simply:

  1. On *nix like systems do chmod a+x rmdstlyechecker.py first, which will make it an executable.

    On w*ndows systems you need to add always apython or a python3 before rmdstylechecker.py!

  2. Simply run it with

    rmdstylechecker.py RmarkdownFileYouWantToCheck.Rmd

    or

    python3 rmdstylechecker.py RmarkdownFileYouWantToCheck.Rmd

If you get nothing but the the number of lines it has scanned, everything is all right. Else you get the line number and the problem found.

Pretty easy!

Yours Norman

PS: And yes! - This could be written in R directly, but I currently prefer Python...

sebastiansauer commented 6 years ago

Thanks! I'll check that an get back to you.

NMarkgraf commented 6 years ago

Thanks a lot! --- I've started to write some of my thought (in german) into my blog. If anybody has any ideas what might get on this list, please drop me a line!