-
Notifications
You must be signed in to change notification settings - Fork 19
Travis CI Builder
Like many other projects, a [Travis CI] (https://travis-ci.org/) builder is attached to LDR Importer. Unlike other projects however, this one exists not to ensure the importer works, but to ensure it is well written.
Because Travis obviously does not host copies of Blender to test the import process for errors, we have to do this ourselves. The purpose of Travis is to test LDR Importer against pep257 and Flake8, a wrapper script for
Upon each commit, be it to a branch, pull request, or a tag, Travis will test the script again Flake8 to check for
- PEP 8 violations
- PEP 257 violations
- Coding errors
- Cyclomatic complexity level
As said already, these tests are run to help ensure LDR Importer's syntax is correct, it conforms to PEP 8 guidelines, and help you code better. If you would like, you can always install Flake8 yourself and test the script as you are coding.
Travis CI is built to treat all non-zero exit codes as errors. If either tool finds an error, Travis says the build has failed although the script may actually work.
Now you may be wondering
How should I respond to the test results? Do I need to attempt to fix all errors before I stop coding?
The answer is always almost "No". Obviously you should use your own judgement here, but you do not have to fix all the errors before you stop coding. You should, however, review the log and check if any errors stem from the area(s) you worked on. If you really can't decide what to do, here is a small list of errors and possible actions.
- Syntax error: These should always be fixed.
- Inefficient coding: Should normally be fixed, but others may catch it and correct it when they push a commit.
-
PEP 8/PEP 257 violations: These can be fixed at a later time or by others. Some may be hard or possible to fix, or the violation may be intentional to improve readability. In that case, add
# noqa
comment to direct Flake8 to ignore that line. - Cyclomatic complexity level: This error is thrown if the score is above ten (10), the highest recommend score before the function is considered too complex. These should be considered by the team as possible (if feasible) areas of improvements later down the road.