Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
A
add-trailing-comma
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
add-trailing-comma
Commits
5f7e02ad
Kaydet (Commit)
5f7e02ad
authored
Tem 14, 2017
tarafından
Anthony Sottile
Kaydeden (comit)
GitHub
Tem 14, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #12 from asottile/escaped_newlines
Better handle escaped newlines
üst
49a0d757
fabc8d04
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
add_trailing_comma.py
add_trailing_comma.py
+3
-2
setup.py
setup.py
+1
-1
add_trailing_comma_test.py
tests/add_trailing_comma_test.py
+5
-0
No files found.
add_trailing_comma.py
Dosyayı görüntüle @
5f7e02ad
...
...
@@ -7,6 +7,7 @@ import collections
import
io
import
sys
from
tokenize_rt
import
ESCAPED_NL
from
tokenize_rt
import
src_to_tokens
from
tokenize_rt
import
Token
from
tokenize_rt
import
tokens_to_src
...
...
@@ -20,8 +21,8 @@ Literal = collections.namedtuple('Literal', ('node', 'backtrack'))
Literal
.
__new__
.
__defaults__
=
(
False
,)
Fix
=
collections
.
namedtuple
(
'Fix'
,
(
'braces'
,
'multi_arg'
,
'initial_indent'
))
NEWLINES
=
frozenset
((
'NEWLINE'
,
'NL'
))
NON_CODING_TOKENS
=
frozenset
((
'COMMENT'
,
'NL'
,
UNIMPORTANT_WS
))
NEWLINES
=
frozenset
((
ESCAPED_NL
,
'NEWLINE'
,
'NL'
))
NON_CODING_TOKENS
=
frozenset
((
'COMMENT'
,
ESCAPED_NL
,
'NL'
,
UNIMPORTANT_WS
))
INDENT_TOKENS
=
frozenset
((
'INDENT'
,
UNIMPORTANT_WS
))
START_BRACES
=
frozenset
((
'('
,
'{'
,
'['
))
END_BRACES
=
frozenset
((
')'
,
'}'
,
']'
))
...
...
setup.py
Dosyayı görüntüle @
5f7e02ad
...
...
@@ -17,7 +17,7 @@ setup(
'Programming Language :: Python :: Implementation :: CPython'
,
'Programming Language :: Python :: Implementation :: PyPy'
,
],
install_requires
=
[
'tokenize-rt'
],
install_requires
=
[
'tokenize-rt
>=2
'
],
py_modules
=
[
'add_trailing_comma'
],
entry_points
=
{
'console_scripts'
:
[
'add-trailing-comma = add_trailing_comma:main'
],
...
...
tests/add_trailing_comma_test.py
Dosyayı görüntüle @
5f7e02ad
...
...
@@ -501,6 +501,11 @@ def test_fix_unhugs_py3_only(src, expected):
' 1, 2, 3, 4,
\n
'
' ],
\n
'
']'
,
# Regression test for #11
'foo.
\\\n
'
' bar(
\n
'
' 5,
\n
'
' )'
,
),
)
def
test_noop_trailing_brace
(
src
):
...
...
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