New Report: Consumer Trends for 2020

We bring together global survey and social data to find the biggest consumer trends in your region.

Get the Report

New Report: Consumer Trends for 2020

We bring together global survey and social data to find the biggest consumer trends in your region.

Get the Report
News

Published July 25th 2014

Committed to the Highest Quality: Introducing Rubocop

Rubocop is a ruby static code analyzer based on the community Ruby style guide. Find out how we use it, and how it helps Brandwatch

Editor’s note: Interested in the Engineering team and what they get up to? They’ve got their own blog over at engineering.brandwatch.com. Head over there for insights into what makes them tick, what they’re working on and other developments behind the scenes.


Serve Brandwatch, protect the codebase, uphold the standards.

In Quality Assurance (QA) at Brandwatch we’re serious about quality within the functionality and code of the products that we build for our clients.

We are always striving to ensure that our various QA frameworks for our amazing products maintain a good standard of quality also, that’s why we’ve made Rubocop a core part of our development process.

RUBOCOP

Rubocop is a ruby static code analyzer based on the community Ruby style guide. Static code analysis is the analysis of code without executing it, this process helps us find bugs in the code and to ensure its conformance to coding guidelines.

We use this process on every pull request (PR) to ensure no one has strayed outside of the high standards we have here within the QA team.

Most aspects of Robocop’s behavior can be tweaked via various configuration options so it even allows us to implement the process quickly on legacy code, meaning we can remove Rubocop offenses within our code bit by bit.

Here’s a quick example.

Someone has been debugging and left a call to the debugger in the code! Luckily Rubocop is here to rectify the problem before a PR gets created.

Rubocop is here to rectify

A quick change in the code base, a re-run of the tests and it’s fixed.

Instead of wasting another person’s time reviewing and commenting on the error, which then needs another commit to fix, we can rectify this problem earlier in the process.

Rubocop in action

We not only run Rubocop when checking our code locally.

Whenever a member of the QA team raises a PR, a Jenkins job is automatically run to check that no Rubocop offenses are in the code. Subject to the Jenkins job result this gets flagged on our PR and sets the appropriate merge status.

If there are any other changes added to the PR the Rubocop Jenkins jobs are run on every subsequent change.

Good to merge

We’ve already found that by using this new process PRs are quicker for the reviewer and help keep the team creating consistent code.

Furthermore, by using consistent code the uptime to learn the framework will be relatively quicker as the same standards are used throughout the framework.

We strive for the highest quality at Brandwatch and Rubocop is helping ensure this remains consistent from every line of code committed.

We're Hiring

Share this post
Categories
Culture Engineering
Search the blog
React Newsletter

Sign-up to receive the latest insights into online trends.

Sign up
facets Created with Sketch.
facets-bottom Created with Sketch.
New: Consumer Research

Be Consumer Fit.

Adapt and win with Consumer Research, our new digital consumer intelligence platform.

Crimson Hexagon has merged with Brandwatch. You’re in the right place!

From May 8th, all Crimson Hexagon products are now on the Brandwatch website. You’ll find them under ‘Products’ in the navigation. If you’re an existing customer and you want to know more, your account manager will be happy to help.