Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
9f220fe0
Commit
9f220fe0
authored
Jul 12, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not misdetect %% as position based format string
parent
59179008
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
trans/checks/format.py
trans/checks/format.py
+2
-2
trans/tests/format_checks.py
trans/tests/format_checks.py
+9
-0
No files found.
trans/checks/format.py
View file @
9f220fe0
...
...
@@ -196,7 +196,7 @@ class PythonFormatCheck(BaseFormatCheck):
regexp
=
PYTHON_PRINTF_MATCH
def
is_position_based
(
self
,
string
):
return
'('
not
in
string
return
'('
not
in
string
and
string
!=
'%'
class
PHPFormatCheck
(
BaseFormatCheck
):
...
...
@@ -210,7 +210,7 @@ class PHPFormatCheck(BaseFormatCheck):
regexp
=
PHP_PRINTF_MATCH
def
is_position_based
(
self
,
string
):
return
'$'
not
in
string
return
'$'
not
in
string
and
string
!=
'%'
class
CFormatCheck
(
BaseFormatCheck
):
...
...
trans/tests/format_checks.py
View file @
9f220fe0
...
...
@@ -132,6 +132,15 @@ class PythonFormatCheckTest(TestCase):
False
))
def
test_reordered_named_format_long
(
self
):
self
.
assertFalse
(
self
.
check
.
check_format
(
u'%(count)d strings into %(languages)d languages %(percent)d%%'
,
u'%(languages)d dil içinde %(count)d satır %%%(percent)d'
,
MockUnit
(
'python_reordered_named_format_long'
),
0
,
False
))
class
PHPFormatCheckTest
(
TestCase
):
def
setUp
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment