Govinda Dasu Govinda Dasu - 11 days ago 5
AngularJS Question

John Papa Style Guide Checker just like pypi pep8

Hi I am going through John Papa's Angular 1 Style Guide. We want to build an automated system to verify that all Angular code pushed by freelancers at our organization complies with the styleguide. Is there any tool out there that can do this for js code, just like how pypi's pep8 does this for python code and the PEP8 Style Guide? Or, do we have to build one from scratch?

If we have to build it from scratch, we would build the checker in Python. Would one use Context Free Grammars (CFGs) -- i.e. NLTK? Or, would one use a python AST Parser to parse and check the js static files?

Answer

In John papa Angular Style Guide, there is a chapter answering this question. He explain all about 22.jshint and 23.jscs. He also provide config files to set them up :)

You can then create a task which will scan your js files and checkup errors regarding those rules. Using pull request pattern, you just refuse any request which does not respect synthaxic rules.

FYI : JSHint is not deprecated and will be slowly replace by eslint.

Comments