Skip to content

Commit f09b9ec

Browse files
author
jef
committed
add old astyle version, adapt prepare-commit.sh to it and include it in the CODING guide
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14597 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 0cdfa40 commit f09b9ec

12 files changed

+8233
-12
lines changed

CODING

+19-10
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Base suffix. This identifies the class as a generated base class.
139139

140140

141141
Examples:
142-
QgsPluginMangerBase
142+
QgsPluginManagerBase
143143
QgsUserOptionsBase
144144

145145

@@ -303,6 +303,13 @@ Braces should start on the line following the expression:
303303
}
304304

305305

306+
There is a scripts/prepare-commit.sh that looks up the changed files and
307+
reindents them using astyle. This should be run before committing.
308+
309+
As newer versions of astyle indent differently than the version used to do a
310+
complete reindentation of the source, the script uses an old astyle version,
311+
that we include in our repository.
312+
306313

307314
1.8. API Compatibility
308315
======================
@@ -348,10 +355,12 @@ errors, development time, and maintenance.
348355

349356

350357
This will:
351-
* allow changes to be made in one location instead of in multiple places
352-
* help prevent code bloat
353-
* make it more difficult for multiple copies to evolve differences over time,
354-
thus making it harder to understand and maintain for others
358+
359+
- allow changes to be made in one location instead of in multiple places
360+
- help prevent code bloat
361+
- make it more difficult for multiple copies to evolve differences over time,
362+
thus making it harder to understand and maintain for others
363+
355364

356365

357366
1.9.2. Prefer Having Constants First in Predicates
@@ -660,7 +669,7 @@ a ticket in trac (https://trac.osgeo.org/qgis/) first and then attach you
660669
This makes it easier for us to apply the patches since we don't need to
661670
navigate to a specific place in the source tree to apply the patch. Also when I
662671
receive patches I usually evaluate them using kompare, and having the patch
663-
from the top level dir makes this much easier. Below is an example of you you
672+
from the top level dir makes this much easier. Below is an example of how you
664673
can include multiple changed files into your patch from the top level
665674
directory:
666675

@@ -689,10 +698,10 @@ patch e.g.
689698

690699
QGIS developers are busy folk. We do scan the incoming patches on bug reports
691700
but sometimes we miss things. Don't be offended or alarmed. Try to identify a
692-
developer to help you - using the ["Project Organigram"] and contact them
701+
developer to help you - using the Project Organigram (http://www.qgis.org/wiki/Project_Organigram) and contact them
693702
asking them if they can look at your patch. If you don't get any response, you
694703
can escalate your query to one of the Project Steering Committee members
695-
(contact details also available on the ["Project Organigram"]).
704+
(contact details also available on the Project Organigram).
696705

697706

698707
2.6.5. Due Diligence
@@ -709,13 +718,13 @@ under the GPL.
709718

710719
Write access to QGIS source tree is by invitation. Typically when a person
711720
submits several (there is no fixed number here) substantial patches that
712-
demonstrate basic competance and understanding of C++ and QGIS coding
721+
demonstrate basic competence and understanding of C++ and QGIS coding
713722
conventions, one of the PSC members or other existing developers can nominate
714723
that person to the PSC for granting of write access. The nominator should give
715724
a basic promotional paragraph of why they think that person should gain write
716725
access. In some cases we will grant write access to non C++ developers e.g. for
717726
translators and documentors. In these cases, the person should still have
718-
demonstrated ability to submit patches and should ideally have submtted several
727+
demonstrated ability to submit patches and should ideally have submitted several
719728
substantial patches that demonstrate their understanding of modifying the code
720729
base without breaking things, etc.
721730

doc/CODING.t2t

+7
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@ Braces should start on the line following the expression:
235235
}
236236
```
237237

238+
There is a scripts/prepare-commit.sh that looks up the changed files and
239+
reindents them using astyle. This should be run before committing.
240+
241+
As newer versions of astyle indent differently than the version used to do a
242+
complete reindentation of the source, the script uses an old astyle version,
243+
that we include in our repository.
244+
238245
== API Compatibility ==
239246

240247
From QGIS 1.0 we will provide a stable, backwards compatible API. This will

doc/build.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
#!/bin/bash
22
txt2tags -o ../INSTALL -t txt INSTALL.t2t
33
txt2tags -o index.html -t html INSTALL.t2t
4+
txt2tags -o ../CODING -t txt CODING.t2t
5+
txt2tags -o CODING.html -t html CODING.t2t

scripts/astyle.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22

3-
if ! type -p astyle >/dev/null; then
3+
ASTYLE=$(dirname $0)/astyle
4+
5+
if ! type -p $ASTYLE >/dev/null; then
46
echo "astyle not found" >&2
57
exit 1
68
fi
@@ -43,5 +45,5 @@ for f in "$@"; do
4345

4446
flip -ub "$f"
4547
#qgsloggermig.pl "$f"
46-
astyle $ARTISTIC_STYLE_OPTIONS "$f"
48+
$ASTYLE $ARTISTIC_STYLE_OPTIONS "$f"
4749
done

0 commit comments

Comments
 (0)