Skip to content

Instantly share code, notes, and snippets.

@lordmauve
lordmauve / check_dubious_concat.py
Created April 8, 2016 14:19
Linter for implicit string literal concatentation in list-like context
def check_dubious_concat(src):
"""Check for suspicious string literal concatenation.
We will warn about instances of string literal concatenation in list-like
contexts - that is, where concatenated string literals are adjacent to
commas or inside square brackets.
Such a heuristic will catch instances like this::
foo = [
@xZise
xZise / branch-status.py
Last active August 29, 2015 14:12
Remove branches which have been merged
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Clean up the git branches by removing branches whose change-id got merged."""
from __future__ import unicode_literals
import argparse
import collections
import itertools
import json
import re