Merge lp:~savoirfairelinux-openerp/lp-community-utils/checkout-pep8 into lp:lp-community-utils

Status: Merged
Approved by: Holger Brunn (Therp)
Approved revision: 27
Merged at revision: 28
Proposed branch: lp:~savoirfairelinux-openerp/lp-community-utils/checkout-pep8
Merge into: lp:lp-community-utils
Diff against target: 51 lines (+47/-0)
1 file modified
checkout-flake8.sh (+47/-0)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/lp-community-utils/checkout-pep8
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Lorenzo Battistini (community) test Approve
Maxime Chambreuil (http://www.savoirfairelinux.com) Approve
Review via email: mp+211098@code.launchpad.net

Description of the change

A tool I use to quickly check pep8 on MPs.

A few people have asked what tool I use, so I though I would put it up here.

The command I use is:
./checkout-flake8.sh lp:launchpad_openerp_repo module_name
for example:
./checkout-flake8.sh lp:~savoirfairelinux-openerp/partner-contact-management/user-firstname/+merge/210710 partner_firstname

It checks it out in /tmp and runs flake8 on the module

To post a comment you must log in.
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) :
review: Approve
Revision history for this message
Lorenzo Battistini (elbati) :
review: Approve (test)
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'checkout-flake8.sh'
2--- checkout-flake8.sh 1970-01-01 00:00:00 +0000
3+++ checkout-flake8.sh 2014-03-14 17:08:06 +0000
4@@ -0,0 +1,47 @@
5+#!/usr/bin/bash
6+
7+# Check if flake8 and bzr exists
8+which flake8 > /dev/null || exit 1
9+which bzr > /dev/null || exit 1
10+# Check that only one parametter was sent
11+if [ "$#" -lt "1" ] || [ "$#" -gt "2" ]
12+ then
13+ echo "Usage:"
14+ echo "$0 lp:repository [SUBDIRECTORY]"
15+ echo "$0 https://code.launchpad.net/~group/repository/branch/+merge/0000000 [SUBDIRECTORY]"
16+ exit 1
17+fi
18+SUBDIR='.'
19+# Subdirectory defined
20+if [ "$#" -eq 2 ]
21+ then
22+ SUBDIR="$2"
23+fi
24+# Check that parameters are actually a bazaar branch
25+bzr info "$1" > /dev/null || exit 1
26+
27+echo "Making a temp directory"
28+mkdir -p "/tmp/checkout-flake/" || exit 1
29+cd "/tmp/checkout-flake/" || exit 1
30+SRCBRANCH=$(echo "${1}" | sed 's,/+merge/[0-9]*$,,g')
31+TODIR=$SRCBRANCH
32+TODIR="${TODIR#lp:}"
33+TODIR="${TODIR#http://}"
34+TODIR="${TODIR#https://}"
35+TODIR="${TODIR////.}"
36+echo branching to $(pwd)/$TODIR
37+if [ -d "$TODIR" ]
38+ then
39+ rm -rf "$TODIR"
40+fi
41+mkdir "$TODIR" || exit 1
42+bzr branch "$SRCBRANCH" --use-existing-dir "$TODIR"
43+cd "$TODIR"
44+echo
45+flake8 "$SUBDIR" --filename __init__.py --ignore F401,E501
46+flake8 "$SUBDIR" --exclude __init__.py --ignore E501
47+echo
48+flake8 "$SUBDIR" --select E501
49+echo
50+
51+echo "Done"

Subscribers

People subscribed via source and target branches