Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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
cpython
Commits
6e0a28f6
Kaydet (Commit)
6e0a28f6
authored
Şub 23, 2000
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Deleting tabpolice.py; it was superceded by tabnanny.py long ago.
üst
a02c898e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
104 deletions
+0
-104
tabpolice.py
Tools/scripts/tabpolice.py
+0
-104
No files found.
Tools/scripts/tabpolice.py
deleted
100755 → 0
Dosyayı görüntüle @
a02c898e
#! /usr/bin/env python
"""The Tab Police watches for possibly inconsistent indentation."""
import
os
import
sys
import
getopt
import
tokenize
verbose
=
0
quiet
=
0
def
main
():
global
verbose
,
quiet
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"qv"
)
except
getopt
.
error
,
msg
:
print
msg
return
for
o
,
a
in
opts
:
if
o
==
'-v'
:
verbose
=
verbose
+
1
quiet
=
0
if
o
==
'-q'
:
quiet
=
1
verbose
=
0
if
not
args
:
print
"Usage:"
,
sys
.
argv
[
0
],
"file_or_directory ..."
return
for
arg
in
args
:
check
(
arg
)
def
check
(
file
):
if
os
.
path
.
isdir
(
file
)
and
not
os
.
path
.
islink
(
file
):
if
verbose
:
print
"
%
s: listing directory"
%
`file`
names
=
os
.
listdir
(
file
)
for
name
in
names
:
fullname
=
os
.
path
.
join
(
file
,
name
)
if
(
os
.
path
.
isdir
(
fullname
)
and
not
os
.
path
.
islink
(
fullname
)
or
os
.
path
.
normcase
(
name
[
-
3
:])
==
".py"
):
check
(
fullname
)
return
try
:
f
=
open
(
file
)
except
IOError
,
msg
:
print
"
%
s: I/O Error:
%
s"
%
(
`file`
,
str
(
msg
))
return
if
verbose
>
1
:
print
"checking"
,
`file`
,
"with tabsize 8..."
tokens
=
[]
tokenize
.
tabsize
=
8
try
:
tokenize
.
tokenize
(
f
.
readline
,
tokens
.
append
)
except
tokenize
.
TokenError
,
msg
:
print
"
%
s: Token Error:
%
s"
%
(
`file`
,
str
(
msg
))
if
verbose
>
1
:
print
"checking"
,
`file`
,
"with tabsize 1..."
f
.
seek
(
0
)
alttokens
=
[]
tokenize
.
tabsize
=
1
try
:
tokenize
.
tokenize
(
f
.
readline
,
alttokens
.
append
)
except
tokenize
.
TokenError
,
msg
:
print
"
%
s: Token Error:
%
s"
%
(
`file`
,
str
(
msg
))
f
.
close
()
if
tokens
==
alttokens
:
if
verbose
:
print
"
%
s: Clean bill of health."
%
`file`
elif
quiet
:
print
file
else
:
badline
=
0
n
,
altn
=
len
(
tokens
),
len
(
alttokens
)
for
i
in
range
(
max
(
n
,
altn
)):
if
i
>=
n
:
x
=
None
else
:
x
=
tokens
[
i
]
if
i
>=
altn
:
y
=
None
else
:
y
=
alttokens
[
i
]
if
x
!=
y
:
if
x
:
kind
,
token
,
start
,
end
,
line
=
x
else
:
kind
,
token
,
start
,
end
,
line
=
y
badline
=
start
[
0
]
break
if
verbose
:
print
"
%
s: *** Line
%
d: trouble in tab city! ***"
%
(
`file`
,
badline
)
print
"offending line:"
,
`line`
else
:
print
file
,
badline
,
`line`
if
__name__
==
'__main__'
:
main
()
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