Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (20 sloc) 1.37 KB

Sugar Edit Fonts Contributing Guidelines

To develop the Activity, your changes must conform to the PEP8 style guide. We use Travis CI to enforce this; the following command is run on every pull request and it must run without outputting any errors:

flake8 --statistics  --ignore=E402 --exclude=defcon,extractor,\
fontTools,fontmake,robofab,ufo2ft,ufoLib,snippets,docs,compreffor,\
booleanOperations,cu2qu,fontMath,glyphsLib,mutatorMath .

The --statistics argument prints a list at the end showing the total count of each error category at the end.

To eliminate all errors, it is helpful to see the total number of errors for each file:

flake8 --ignore=E402 \
--exclude=defcon,extractor,fontTools,fontmake,robofab,\
ufo2ft,ufoLib,snippets,docs,compreffor,booleanOperations,\
cu2qu,fontMath,glyphsLib,mutatorMath  . \
| cut -d: -f1 | sort | uniq -c | sort;

To eliminate a specific error, it is helpful to filter the output using grep:

flake8 --ignore=E402 \
--exclude=defcon,extractor,robofab,ufo2ft,ufoLib,snippets,docs,compreffor,\
booleanOperations,cu2qu,fontMath,glyphsLib,mutatorMath  . \
| grep W291; # trailing whitespace

The autopep8 tool can be used to automatically format code to comply with this standard.