Skip to content
Permalink
Browse files

Merge pull request #3857 from 3nids/spellingtest

Check spelling on travis
  • Loading branch information
3nids committed Dec 15, 2016
2 parents 94b0de5 + 1090e8b commit 49055c642bafe832c04b2d7e0494e04d499d4757
@@ -22,6 +22,7 @@ matrix:
- llvm-toolchain-precise-3.8
- ubuntu-toolchain-r-test
- george-edison55-precise-backports # doxygen 1.8.3
# - laurent-boulard-devtools not whitelisted yet https://github.com/travis-ci/apt-source-whitelist/pull/345
packages:
- doxygen
- bison
@@ -36,11 +37,15 @@ matrix:
- xvfb
- flip
- clang-3.8
# used for spell checks
# - silversearcher-ag not available in precise nor in a white listed ppa (in osgeo4travis as for now)
- expect-dev # unbuffer
# OSX based build with QT4 and Python 2
# - os: osx
# env:
# - BUILD=osx
# - IGNORE_BUILD_FAILURES=YES


git:
depth: 30
@@ -70,6 +75,7 @@ before_script:

script:
- ./ci/travis/${TRAVIS_OS_NAME}/script.sh
- ./ci/travis/check_spelling.sh

after_script:
- ./ci/travis/${TRAVIS_OS_NAME}/after_script.sh
@@ -0,0 +1,16 @@
#!/bin/bash
set -e

export PATH=${HOME}/osgeo4travis/bin:${PATH}


echo "Spell check"

if [[ ! -z $TRAVIS_PULL_REQUEST_BRANCH ]]; then
# if on a PR, just analyse the changed files
echo "TRAVIS PR BRANCH: $TRAVIS_PULL_REQUEST_BRANCH"
FILES=$(git diff --name-only HEAD $(git merge-base HEAD master) | tr '\n' ' ' )
fi

./scripts/chkspelling_ag.sh $FILES

@@ -38,7 +38,7 @@ class QgsActionScopeRegistry : QObject
/**
* Create a new QgsActionScopeRegistry.
* QGIS already creates a central registry. You will normally
* want to use QgsApplication::actionScopeRegistry() to get acess
* want to use QgsApplication::actionScopeRegistry() to get access
* to that one instead.
*
* @note Added in QGIS 3.0
@@ -117,10 +117,10 @@ class QgsTask : QObject
* Subtasks allow a single task to be created which
* consists of multiple smaller tasks. Subtasks are not visible or indepedently
* controllable by users. Ownership of the subtask is transferred.
* Subtasks can have an optional list of dependant tasks, which must be completed
* Subtasks can have an optional list of dependent tasks, which must be completed
* before the subtask can begin. By default subtasks are considered independent
* of the parent task, ie they can be run either before, after, or at the same
* time as the parent task. This behaviour can be overriden through the subTaskDependency
* time as the parent task. This behaviour can be overridden through the subTaskDependency
* argument.
*
* The parent task must be added to a QgsTaskManager for subtasks to be utilised.
@@ -286,7 +286,7 @@ class QgsTaskManager : QObject
long addTask( QgsTask* task /Transfer/, int priority = 0 );

/**
* Adds a task to the manager, using a full task definition (including dependancy
* Adds a task to the manager, using a full task definition (including dependency
* handling). Ownership of the task is transferred to the manager, and the task
* manager will be responsible for starting the task. The priority argument can
* be used to control the run queue's order of execution.
@@ -263,7 +263,7 @@ class QgsStyle : QObject
*/
QStringList tagsOfSymbol( StyleEntity type, const QString& symbol );

/** Returns wheter a given tag is associated with the symbol
/** Returns whether a given tag is associated with the symbol
*
* \param type is either SymbolEntity or ColorrampEntity
* \param symbol is the name of the symbol or color ramp
@@ -90,7 +90,7 @@ qgis:countuniquepointsinpolygon: >
A new polygons layer is generated, with the exact same content as the input polygons layer, but containing an additional field with the points count corresponding to each polygon.

qgis:createattributeindex: >
Creates an index to speed up queries made against a field in a table. Support for index creation is dependant on the layer's data provider and the field type.
Creates an index to speed up queries made against a field in a table. Support for index creation is dependent on the layer's data provider and the field type.

qgis:createconstantrasterlayer: >
Given an input raster layer an a value, this algorithm generates a new layer with the same extent and cellsize as the input one, and all cells with the specified value.
@@ -56,7 +56,7 @@ def defineCharacteristics(self):
self.addParameter(ParameterVector(self.INPUT_B,
self.tr('Split layer'), [dataobjects.TYPE_VECTOR_LINE]))

self.addOutput(OutputVector(self.OUTPUT, self.tr('Splitted'), datatype=[dataobjects.TYPE_VECTOR_LINE]))
self.addOutput(OutputVector(self.OUTPUT, self.tr('Split'), datatype=[dataobjects.TYPE_VECTOR_LINE]))

def processAlgorithm(self, progress):
layerA = dataobjects.getObjectFromUri(self.getParameterValue(self.INPUT_A))
@@ -0,0 +1,38 @@
# Folders
.build*/
ci/
debian/build.*/
debian/build*/
debian/.*/usr/
i18n/
ms-windows/osgeo4w/
python/ext-libs/
python/plugins/processing/algs/otb/
python/plugins/processing/algs/saga/
python/qsci_apis/
src/app/dwg/libdxfrw/
src/app/gps/qwtpolar-1.0/
src/app/gps/qwtpolar-1.1.1/
src/plugins/grass/qtermwidget/

#Extensions
*.*.orig
*.*.sortinc
*.*.prepare


#Specific files
ChangeLog
Exception_to_GPL_for_Qt.txt
images/themes/default/svgbase/hammer.svg
images/themes/default/propertyicons/general.svg
LexerR.py
spelling.dat
resources/cpt-city-qgis-min/fme/metres/DESC.xml
resources/cpt-city-qgis-min/wkp/schwarzwald/COPYING.xml
tests/src/python/test_qgsserver_accesscontrol.py
tests/testdata/qgis_server/ets-wms13/project.qgs
tests/testdata/qgis_server_accesscontrol/project.qgs
tests/testdata/qgis_server_accesscontrol/Hello.qml


@@ -0,0 +1,41 @@
#!/bin/bash
###########################################################################
# chkspelling.sh
# ---------------------
# Date : December 2016
# Copyright : (C) 2016 by Denis Rouzaud
# Email : denis.rouzaud@gmail.com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################

# optional arguments: files to be checked
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

AGIGNORE=${DIR}/.agignore

RE=$(cut -d: -f1 scripts/spelling.dat | tr '\n' '\|' | sed -e 's/|$//')
if [ ! $# -eq 0 ]; then
EXCLUDE=$(cat $AGIGNORE | sed -e 's/\s*#.*$//' -e '/^\s*$/d' | tr '\n' '|' | sed -e 's/|$//')
FILES=$(echo $@ | tr -s '[[:blank:]]' '\n' | egrep -iv "$EXCLUDE" | tr '\n' ' ' )
echo "Running spell check on files: $FILES"
else
FILES="."
fi


exec 5>&1
OUTPUT=$(unbuffer ag --smart-case --all-text --nopager --numbers --word-regexp --path-to-ignore $AGIGNORE "$RE" $FILES |tee /dev/fd/5)


if [[ ! -z $OUTPUT ]]; then
echo "Spelling errors have been found"
exit 1
else
exit 0
fi
@@ -21,30 +21,32 @@ PATH=$TOPLEVEL/scripts:$PATH
cd $TOPLEVEL

if ! type -p astyle.sh >/dev/null; then
echo astyle.sh not found
exit 1
echo astyle.sh not found
exit 1
fi

if ! type -p colordiff >/dev/null; then
colordiff()
{
cat "$@"
}
colordiff()
{
cat "$@"
}
fi

if [ "$1" = "-c" ]; then
echo "Cleaning..."
remove_temporary_files.sh
echo "Cleaning..."
remove_temporary_files.sh
fi

set -e

# determine changed files
MODIFIED=$(git status --porcelain| sed -ne "s/^ *[MA] *//p" | sort -u)
${TOPLEVEL}/scripts/chkspelling_ag.sh $MODIFIED


if [ -z "$MODIFIED" ]; then
echo nothing was modified
exit 0
echo nothing was modified
exit 0
fi

# save original changes
@@ -58,42 +60,42 @@ ASTYLEDIFF=astyle.$REV.diff
i=0
N=$(echo $MODIFIED | wc -w)
for f in $MODIFIED; do
(( i++ )) || true

case "$f" in
src/core/gps/qextserialport/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*)
echo $f skipped
continue
;;

*.cpp|*.c|*.h|*.cxx|*.hxx|*.c++|*.h++|*.cc|*.hh|*.C|*.H|*.sip|*.py)
;;

*)
continue
;;
esac

m=$f.$REV.prepare

cp $f $m
ASTYLEPROGRESS=" [$i/$N]" astyle.sh $f
if diff -u $m $f >>$ASTYLEDIFF; then
# no difference found
rm $m
fi
(( i++ )) || true

case "$f" in
src/core/gps/qextserialport/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*)
echo $f skipped
continue
;;

*.cpp|*.c|*.h|*.cxx|*.hxx|*.c++|*.h++|*.cc|*.hh|*.C|*.H|*.sip|*.py)
;;

*)
continue
;;
esac

m=$f.$REV.prepare

cp $f $m
ASTYLEPROGRESS=" [$i/$N]" astyle.sh $f
if diff -u $m $f >>$ASTYLEDIFF; then
# no difference found
rm $m
fi
done

if [ -s "$ASTYLEDIFF" ]; then
if tty -s; then
# review astyle changes
colordiff <$ASTYLEDIFF | less -r
else
echo "Files changed (see $ASTYLEDIFF)"
fi
exit 1
if tty -s; then
# review astyle changes
colordiff <$ASTYLEDIFF | less -r
else
echo "Files changed (see $ASTYLEDIFF)"
fi
exit 1
else
rm $ASTYLEDIFF
rm $ASTYLEDIFF
fi

exit 0
@@ -313,6 +313,8 @@ optionnal:optional
optmizations:optimizations
orientatied:orientated
orientied:oriented
orthagonal:orthogonal
orthagonalize:orthogonalize
overaall:overall
overidden:overridden
overide:override
@@ -44,7 +44,7 @@ class CORE_EXPORT QgsActionScopeRegistry : public QObject
/**
* Create a new QgsActionScopeRegistry.
* QGIS already creates a central registry. You will normally
* want to use QgsApplication::actionScopeRegistry() to get acess
* want to use QgsApplication::actionScopeRegistry() to get access
* to that one instead.
*
* @note Added in QGIS 3.0
@@ -626,7 +626,7 @@ void QgsTaskManager::taskStatusChanged( int status )

if ( status == QgsTask::Terminated )
{
//recursively cancel dependant tasks
//recursively cancel dependent tasks
cancelDependentTasks( id );
}

@@ -790,9 +790,9 @@ void QgsTaskManager::cancelDependentTasks( long taskId )
{
if ( it.value().contains( cancelledTask ) )
{
// found task with this dependancy
// found task with this dependency

// cancel it - note that this will be recursive, so any tasks dependant
// cancel it - note that this will be recursive, so any tasks dependent
// on this one will also be cancelled
QgsTask* dependentTask = task( it.key() );
if ( dependentTask )
@@ -148,10 +148,10 @@ class CORE_EXPORT QgsTask : public QObject
* Subtasks allow a single task to be created which
* consists of multiple smaller tasks. Subtasks are not visible or indepedently
* controllable by users. Ownership of the subtask is transferred.
* Subtasks can have an optional list of dependant tasks, which must be completed
* Subtasks can have an optional list of dependent tasks, which must be completed
* before the subtask can begin. By default subtasks are considered independent
* of the parent task, ie they can be run either before, after, or at the same
* time as the parent task. This behaviour can be overriden through the subTaskDependency
* time as the parent task. This behaviour can be overridden through the subTaskDependency
* argument. Note that subtasks should NEVER be dependent on their parent task, and violating
* this constraint will prevent the task from completing successfully.
*
@@ -381,7 +381,7 @@ class CORE_EXPORT QgsTaskManager : public QObject
long addTask( QgsTask* task, int priority = 0 );

/**
* Adds a task to the manager, using a full task definition (including dependancy
* Adds a task to the manager, using a full task definition (including dependency
* handling). Ownership of the task is transferred to the manager, and the task
* manager will be responsible for starting the task. The priority argument can
* be used to control the run queue's order of execution, with larger numbers
@@ -333,7 +333,7 @@ class CORE_EXPORT QgsStyle : public QObject
*/
QStringList tagsOfSymbol( StyleEntity type, const QString& symbol );

/** Returns wheter a given tag is associated with the symbol
/** Returns whether a given tag is associated with the symbol
*
* \param type is either SymbolEntity or ColorrampEntity
* \param symbol is the name of the symbol or color ramp
@@ -91,7 +91,7 @@
<item>
<widget class="QPushButton" name="pbDeselectAll">
<property name="text">
<string>Unselect all</string>
<string>Deselect all</string>
</property>
</widget>
</item>

2 comments on commit 49055c6

@alexbruy

This comment has been minimized.

Copy link
Contributor

@alexbruy alexbruy replied Dec 19, 2016

Seems spellchecking causes Travis failures when PR removes some files, see for example https://travis-ci.org/qgis/QGIS/builds/184481431#L1400 or https://travis-ci.org/qgis/QGIS/builds/185214040#L1401

@3nids

This comment has been minimized.

Copy link
Member Author

@3nids 3nids replied Dec 19, 2016

Yes I noticed. Will fix this asap.

Please sign in to comment.
You can’t perform that action at this time.