这是indexloc提供的服务,不要输入任何密码
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .astylerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Formatting options for
## Astyle - Source code indenter, formatter, and beautifier for C, C++, and Java Source Code
## http://astyle.sourceforge.net/

# Indent as C/C++
mode=c
# Use LF line end style
lineend=linux

# Allman style formatting/indenting uses broken brackets
style=allman

# Grant an exception to the Allman style bracketing for `extern "c"` statements.
attach-extern-c
# Attach while statement to closing bracket of a do {} while statment
attach-closing-while

# Indent using 4 spaces per indent
indent=spaces=4
convert-tabs
# Indent labels so they match the current indentation rather than being flush to the left
indent-labels
# Make sure all comments are indented with the code
indent-col1-comments
# No min indents for a header is built of multiple lines. This assures they are always aligned.
min-conditional-indent=0
# Don't restrict the max contiunation indent as much as possible. Still, it shouldn't be close to 120 ever.
max-continuation-indent=120

# Insert space padding around operators and after commas
pad-oper
# Remove unnecessary padding around parentheses
unpad-paren
# Attach pointers and references to the variable name
align-pointer=name
# Insert space padding after paren headers only (e.g. 'if', 'for', 'while'...)
pad-header

# Add braces to one-line conditional statements
add-braces
# Leave one-line blocks as-is. This should only be used with single statements.
keep-one-line-blocks

# Exclude third-party libraries
exclude=miniz.cpp
exclude=miniz.h
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ addons:
- graphviz
- python3
- python3-pip
- astyle

before_install:
- |
Expand All @@ -57,7 +58,7 @@ before_install:
if [ "$ver" -le "27" ]; then
brew upgrade python;
fi
brew install p7zip qt gpg;
brew install p7zip qt gpg astyle;
brew link qt --force;
fi

Expand All @@ -70,10 +71,14 @@ install:
- pip3 -V

before_script:
- echo "are changes related to source code?"
- 'echo "Checking style guidelines";
astyle -rn --project "./*.cpp" "./*.h";
git diff;
git checkout -- .;'
- echo "Are changes related to source code?"
- 'if [ "$TRAVIS_BRANCH" != "release" ]; then
bash $TRAVIS_BUILD_DIR/util/checkchanges.sh;
fi'
bash $TRAVIS_BUILD_DIR/util/checkchanges.sh;
fi'
- 'if [ "$TRAVIS_OS_NAME" == "linux" ]; then
. /opt/qt59/bin/qt59-env.sh;
export DISPLAY=:99.0;
Expand Down
40 changes: 40 additions & 0 deletions util/qt_creator_code_style.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorCodeStyle>
<!-- Written by QtCreator 4.8.1, 2019-09-27T22:24:51. -->
<qtcreator>
<data>
<variable>CodeStyleData</variable>
<valuemap type="QVariantMap">
<value type="bool" key="AlignAssignments">true</value>
<value type="bool" key="AutoSpacesForTabs">false</value>
<value type="bool" key="BindStarToIdentifier">true</value>
<value type="bool" key="BindStarToLeftSpecifier">false</value>
<value type="bool" key="BindStarToRightSpecifier">false</value>
<value type="bool" key="BindStarToTypeName">false</value>
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">false</value>
<value type="bool" key="IndentAccessSpecifiers">false</value>
<value type="bool" key="IndentBlockBody">true</value>
<value type="bool" key="IndentBlockBraces">false</value>
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
<value type="bool" key="IndentClassBraces">false</value>
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
<value type="bool" key="IndentEnumBraces">false</value>
<value type="bool" key="IndentFunctionBody">true</value>
<value type="bool" key="IndentFunctionBraces">false</value>
<value type="bool" key="IndentNamespaceBody">false</value>
<value type="bool" key="IndentNamespaceBraces">false</value>
<value type="int" key="IndentSize">4</value>
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentSwitchLabels">false</value>
<value type="int" key="PaddingMode">2</value>
<value type="bool" key="ShortGetterName">false</value>
<value type="bool" key="SpacesForTabs">true</value>
<value type="int" key="TabSize">4</value>
</valuemap>
</data>
<data>
<variable>DisplayName</variable>
<value type="QString">Pencil2D</value>
</data>
</qtcreator>