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
a5d55bae
Kaydet (Commit)
a5d55bae
authored
Mar 28, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Update the suspicious builder to detect unused rules, and remove currently unusued rules.
üst
44ea77bd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
susp-ignored.csv
Doc/tools/sphinxext/susp-ignored.csv
+0
-0
suspicious.py
Doc/tools/sphinxext/suspicious.py
+11
-0
No files found.
Doc/tools/sphinxext/susp-ignored.csv
Dosyayı görüntüle @
a5d55bae
This diff is collapsed.
Click to expand it.
Doc/tools/sphinxext/suspicious.py
Dosyayı görüntüle @
a5d55bae
...
...
@@ -68,6 +68,10 @@ class Rule:
# None -> don't care
self
.
issue
=
issue
# the markup fragment that triggered this rule
self
.
line
=
line
# text of the container element (single line only)
self
.
used
=
False
def
__repr__
(
self
):
return
'{0.docname},,{0.issue},{0.line}'
.
format
(
self
)
...
...
@@ -107,6 +111,12 @@ class CheckSuspiciousMarkupBuilder(Builder):
doctree
.
walk
(
visitor
)
def
finish
(
self
):
unused_rules
=
[
rule
for
rule
in
self
.
rules
if
not
rule
.
used
]
if
unused_rules
:
self
.
warn
(
'Found
%
s/
%
s unused rules:'
%
(
len
(
unused_rules
),
len
(
self
.
rules
)))
for
rule
in
unused_rules
:
self
.
info
(
repr
(
rule
))
return
def
check_issue
(
self
,
line
,
lineno
,
issue
):
...
...
@@ -131,6 +141,7 @@ class CheckSuspiciousMarkupBuilder(Builder):
if
(
rule
.
lineno
is
not
None
)
and
\
abs
(
rule
.
lineno
-
lineno
)
>
5
:
continue
# if it came this far, the rule matched
rule
.
used
=
True
return
True
return
False
...
...
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