Pull requests made to your repositories can now be analysed by Landscape, to provide you with a list of errors that the pull request introduces or fixes. Now you can see at a glance whether merging a change will improve or harm your overall code quality!

When somebody submits a bug request or a new feature using GitHub's pull request functionality, Landscape will pull down the new code and compare it, giving you a list of anything new problems and a list of fixed problems. It will also add a comment to the pull request summarising the differences, like this:

Landscape Bot example comment

If you think you can cope without this most excellent feature, you can turn it off on the preferences page for the relevant organisation as a whole, or on a per-repository basis - look for the universal symbol of settings at the top right, the cog.

Comments on private repositories

Unfortunately, the friendly Landscape Bot does not have access to your private repositories. For pull requests to private repositories, Landscape will use the GitHub API to post comments as one of the members of your organisation. You can choose which of your users will be used for comments on the organisation settings page.

Using a bot account

For organisations with private repositories, it makes a lot of sense to use a specific bot account for comments instead of a user. This makes the comments a bit less confusing in the future, especially if that user leaves your organisation!

  1. Create a new account on GitHub, or log in to an existing account if you already have some kind of CI-bot account.
  2. Log in to Landscape using the bot.
  3. Make sure that Landscape can see private repositories - you can do that on the preferences page.
  4. Log in using your normal account. You can change the settings for your organisation to use your new bot!

(By the way, creating bots for purposes like this is perfectly fine according to GitHub)

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

About Landscape.io

Landscape.io 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.