Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Iris
RefinedC
Commits
4d7ad7dd
Commit
4d7ad7dd
authored
Nov 18, 2020
by
Michael Sammler
Browse files
fixed annotation count for new tokei version
parent
e9873033
Changes
1
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
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