Skip to content

Commit

Permalink
add override support to qgisstyle
Browse files Browse the repository at this point in the history
include pep8 call in indentation run for python code
  • Loading branch information
jef-n committed Feb 11, 2015
1 parent 47488f2 commit 10e09bc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/astyle.sh
Expand Up @@ -29,11 +29,19 @@ if [ -z "$ASTYLE" ]; then
fi

if ! type -p flip >/dev/null; then
echo "flip not found" >&2
flip() {
:
}
fi

if ! type -p pep8 >/dev/null; then
echo "pep8 not found" >&2
pep8() {
:
}
fi

set -e

export ARTISTIC_STYLE_OPTIONS="\
Expand All @@ -60,7 +68,7 @@ $ARTISTIC_STYLE_OPTIONS \

for f in "$@"; do
case "$f" in
src/app/gps/qwtpolar-*|src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|src/astyle/*|python/ext-libs/*|src/providers/spatialite/qspatialite/*|src/plugins/dxf2shp_converter/dxflib/src/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*)
src/app/gps/qwtpolar-*|src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|src/astyle/*|python/ext-libs/*|src/providers/spatialite/qspatialite/*|src/plugins/dxf2shp_converter/dxflib/src/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*|python/ext-libs/*|*/ui_*.py)
echo -ne "$f skipped $elcr"
continue
;;
Expand All @@ -73,11 +81,11 @@ for f in "$@"; do
cmd=:
;;

python/ext-libs/*)
cmd=:
*.py)
cmd="pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701"
;;

*.py|*.sip)
*.sip)
cmd="perl -i.prepare -pe 's/[\r\t ]+$//;'"
;;

Expand Down
3 changes: 3 additions & 0 deletions src/astyle/ASResource.cpp
Expand Up @@ -57,6 +57,7 @@ const string ASResource::AS_CATCH = string("catch");
const string ASResource::AS_FINALLY = string("finally");
const string ASResource::AS_THROWS = string("throws");
const string ASResource::AS_CONST = string("const");
const string ASResource::AS_OVERRIDE = string("override");

const string ASResource::AS_ASM = string("asm");

Expand Down Expand Up @@ -211,6 +212,7 @@ void ASResource::buildHeaders(vector<const string*> &headers, int fileType, bool
headers.push_back(&AS_STATIC);
headers.push_back(&AS_EXTERN);
headers.push_back(&AS_TEMPLATE);
headers.push_back(&AS_OVERRIDE);
}

if (fileType == JAVA_TYPE)
Expand Down Expand Up @@ -282,6 +284,7 @@ void ASResource::buildNonParenHeaders(vector<const string*> &nonParenHeaders, in
nonParenHeaders.push_back(&AS_STATIC);
nonParenHeaders.push_back(&AS_EXTERN);
nonParenHeaders.push_back(&AS_TEMPLATE);
nonParenHeaders.push_back(&AS_OVERRIDE);
}

if (fileType == JAVA_TYPE)
Expand Down
1 change: 1 addition & 0 deletions src/astyle/astyle.h
Expand Up @@ -118,6 +118,7 @@ class ASResource
static const string AS_CLASS, AS_STRUCT, AS_UNION, AS_INTERFACE, AS_NAMESPACE, AS_EXTERN;
static const string AS_STATIC;
static const string AS_CONST;
static const string AS_OVERRIDE;
static const string AS_SYNCHRONIZED;
static const string AS_OPERATOR, AS_TEMPLATE;
static const string AS_OPEN_BRACKET, AS_CLOSE_BRACKET;
Expand Down

0 comments on commit 10e09bc

Please sign in to comment.