Previously, Landscape would create a comment on pull requests showing the change in code quality introduced by the proposed code. This was often quite spammy, though, and therefore pul request status is now set using GitHub's status API.

This means that, when you create a pull request, you will see something like this:

pull request status example

The default behaviour is simply to add information about the code check to the pull request. If you like, you can have Landscape mark the pull request as "failed" if code quality deteriorates - you can do this in your preferences either for entire organisations or on a per-repository basis.

Currently, failing can only be triggered by any decrease in score. If you would like to have different criteria - for example, fail due to new errors only but don't worry about smells - please file an issue on the issue tracker or drop me an email so I can figure out what kind of behaviour is useful!

The old commenting system is still available but has been disabled by default in favour of the status updates. You can however enable it in your preferences. It can still sometimes be useful if you tend to make pull requests then add more commits afterwards, as with the status-api, it only represents the most recent commit of the PR branch. The bot comments allow you to see how new commits compare to old commits, if that history is useful to you.

This fixes issues #108, #158 and #160.

Faster Checks

The slowest part of the checks for some time has been setting up a virtual environment and installing the various requirements of projects. This is necessary to help with inferring types and APIs used by project code - without the complete requirements, there are often several incorrect or spurious warnings.

These requirements are now cached between checks. The first check will still be slow as the environment is buit for the first time, but afterwards the requirements installation is a lot faster, and will only need to fetch and install libraries if the versions depended on have changed.

If you enjoyed this article and would like to receive email notifications when new articles are published, sign up below:

About is a tool to measure and track code quality and technical debt in your project. It can analyse Python code to point out errors and problems, and provides continuous metrics so you can see if your code is deteriorating.