Closed Bug 1101253 Opened 11 years ago Closed 11 years ago

Automated way of checking for snippet code guideline compliance

Categories

(Snippets Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: osmose, Assigned: koddsson, Mentored)

Details

There are requirements for snippet code documented at https://abouthome-snippets-service.readthedocs.org/en/latest/developing.html#snippet-requirements. There's also some style guides used across webdev that we like to subscribe to, documented at http://mozweb.readthedocs.org/en/latest/. It's a PITA to spend time during code reviews bothering with these nits. gvn posted an interesting blog post (https://gist.github.com/gvn/7536832) essentially recommending that you automate these rules rather than making humans check them. I think this is a grand idea, and one that should be investigated! One possible piece of this could be stylecop, potch's project to easily enforce odd rules against a CSS codebase: https://github.com/potch/stylecop
Since you linked mozweb read the docs does this mean that we are following PEP8 in snippets?
(In reply to Kristján Oddsson [:koddsson] from comment #1) > Since you linked mozweb read the docs does this mean that we are following > PEP8 in snippets? Snippets the service, yes, with a few allowances (such as 100-character lines instead of 80 and leniency with how you prefer to format your docstrings). But this bug is about snippet code, as in the HTML/CSS/JavaScript in an individual snippet. We often have people external to the team making snippets, and an automated tool would help them.
Fixed and merged in https://github.com/mozilla/snippets-service/compare/c707e13d6c15...8b4bcb04ad73. Travis should now comment on PRs with linting status. Nice work!
Assignee: nobody → koddsson
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: Snippets → Snippets Graveyard
You need to log in before you can comment on or make changes to this bug.