Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Fengmin Zhu
RefinedC
Commits
4d7ad7dd
Commit
4d7ad7dd
authored
Nov 18, 2020
by
Michael Sammler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed annotation count for new tokei version
parent
e9873033
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
count_annotations.py
count_annotations.py
+5
-4
No files found.
count_annotations.py
View file @
4d7ad7dd
...
...
@@ -100,13 +100,14 @@ def parse_file(f):
def
compute_annots
(
FILES
):
total
=
{}
o
=
subprocess
.
check_output
([
"tokei"
,
"--output=json"
,
"--files"
]
+
FILES
)
inner
=
json
.
loads
(
o
)[
"inner"
]
print
(
o
)
inner
=
json
.
loads
(
o
)
if
"CHeader"
not
in
inner
:
inner
[
"CHeader"
]
=
{
"code"
:
0
,
"
sta
ts"
:
[]}
inner
[
"CHeader"
]
=
{
"code"
:
0
,
"
repor
ts"
:
[]}
lines_total
=
inner
[
"C"
][
"code"
]
+
inner
[
"CHeader"
][
"code"
]
lines_per_file
=
{}
for
s
in
inner
[
"C"
][
"
sta
ts"
]
+
inner
[
"CHeader"
][
"
sta
ts"
]:
lines_per_file
[
s
[
"name"
]]
=
s
[
"code"
]
for
s
in
inner
[
"C"
][
"
repor
ts"
]
+
inner
[
"CHeader"
][
"
repor
ts"
]:
lines_per_file
[
s
[
"name"
]]
=
s
[
"
stats"
][
"
code"
]
# count annotations
for
f
in
FILES
:
...
...
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