lhcb / first-analysis-steps

LHCb data analysis lessons
https://lhcb.github.io/first-analysis-steps/
12 stars 55 forks source link

linter for example code #37

Open betatim opened 9 years ago

betatim commented 9 years ago

Good ideas how to lint our examples? This would solve the problem of having to argue with people about how to format things and keep things tidy.

apuignav commented 9 years ago

Argh, I've found linting LHCb software to be extremely tricky because you need the full stack for the linter to recgnize all the Gaudi imports. I am not sure we can make Travis do that, but I agree it would be a nice addition.

What I usually run is pylint and if it passes flake8. This gives properly formatted code (even if I don't agree with some of the formatting rules) but it doesn't bother you about it until the syntax is fixed.

kdungs commented 9 years ago

Something much more superficial would be pep8 it just checks the formatting of your code (line length, spaces, vertical white space, …)

betatim commented 9 years ago

Do you know how to run pep8 on our .md files though? I think pep8 would be more than good enough.

On Sat, May 23, 2015 at 12:11 PM Kevin Dungs notifications@github.com wrote:

Something much more superficial would be pep8 it just checks the formatting of your code (line length, spaces, vertical white space, …)

— Reply to this email directly or view it on GitHub https://github.com/lhcb/first-analysis-steps/issues/37#issuecomment-104878926 .

kdungs commented 9 years ago

My best guess would be that one would have to write a custom pandocfilter for that.

kdungs commented 9 years ago

With the recent merge of #70, this is resolved now, no?

alexpearce commented 9 years ago

I suppose there's still the ‘issue’ of checking the code that's inline with the lessons. Do you think it's worth checking those?

kdungs commented 9 years ago

:crying_cat_face: Well... I started working on it and is indeed possible to build something with pandoc that would do this. Maybe keep the idea for later.

ibab commented 9 years ago

We could also do it without pandoc using a package like this one: https://www.npmjs.com/package/tests-ex-markdown