Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-dev-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-dev-tools
Commits
81b63e2a
Commit
81b63e2a
authored
11 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
Correct check for whitespace around braces
parent
a45c3f0d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
check_source/check_style_c.py
+4
-2
4 additions, 2 deletions
check_source/check_style_c.py
with
4 additions
and
2 deletions
check_source/check_style_c.py
+
4
−
2
View file @
81b63e2a
...
...
@@ -157,6 +157,8 @@ def tk_match_backet(index):
index_match
=
index
+
direction
while
True
:
item
=
tokens
[
index_match
]
# For checking odd braces:
# print(filepath, tokens[index].line, item.line)
if
item
.
type
==
Token
.
Punctuation
:
if
item
.
text
==
backet_start
:
level
+=
1
...
...
@@ -330,7 +332,7 @@ def blender_check_kw_if(index_kw_start, index_kw, index_kw_end):
# check for: ){
index_next
=
tk_advance_ws_newline
(
index_kw_end
,
1
)
if
tokens
[
index_next
].
type
==
Token
.
Punctuation
and
tokens
[
index_next
].
text
==
"
{
"
:
if
not
tk_item_is_ws
(
tokens
[
index_next
-
1
]):
if
not
tk_item_is_ws
_newline
(
tokens
[
index_next
-
1
]):
warning
(
"
no white space between trailing bracket
'
%s (){
'"
%
tokens
[
index_kw
].
text
,
index_kw_start
,
index_kw_end
)
# check for: if ()
...
...
@@ -368,7 +370,7 @@ def blender_check_kw_if(index_kw_start, index_kw, index_kw_end):
warning
(
"
multi-line should use a on a new line
'
%s (
\\
n
\\
n) {
'"
%
tokens
[
index_kw
].
text
,
index_kw
,
index_kw_end
)
# Note: this could be split into its own function
# since its not spe
s
ific to if-statements,
# since its not spe
c
ific to if-statements,
# can also work for function calls.
#
# check indentation on a multi-line statement:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment