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)
Snippets Graveyard
General
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
| Assignee | ||
Comment 1•11 years ago
|
||
Since you linked mozweb read the docs does this mean that we are following PEP8 in snippets?
| Reporter | ||
Comment 2•11 years ago
|
||
(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.
Comment 3•11 years ago
|
||
Commit pushed to master at https://github.com/mozilla/snippets-service
https://github.com/mozilla/snippets-service/commit/8ac8ae045a39c54687243ae6d489f3ba0cf3be23
[bug 1101253] Add flake8 check to travis.
| Reporter | ||
Comment 4•11 years ago
|
||
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
Updated•6 years ago
|
Product: Snippets → Snippets Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•