Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Moore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LHCb
Moore
Commits
7a15ca74
Commit
7a15ca74
authored
3 years ago
by
Rosen Matev
Browse files
Options
Downloads
Patches
Plain Diff
Use LbEnv for style checks and fix formatting
parent
b0fa48b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1043
Use LbEnv for style checks and fix formatting
Pipeline
#3084803
waiting for manual action
Stage: check
Stage: build
Stage: docs
Stage: .post
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+4
-1
4 additions, 1 deletion
.gitlab-ci.yml
doc/make_functor_docs.py
+30
-37
30 additions, 37 deletions
doc/make_functor_docs.py
with
34 additions
and
38 deletions
.gitlab-ci.yml
+
4
−
1
View file @
7a15ca74
...
...
@@ -31,8 +31,11 @@ check-copyright:
check-formatting
:
stage
:
check
image
:
gitlab-registry.cern.ch/lhcb-docker/style-checker
tags
:
-
cvmfs
image
:
gitlab-registry.cern.ch/ci-tools/ci-worker:cc7
script
:
-
. /cvmfs/lhcb.cern.ch/lib/LbEnv.sh
-
if [ ! -e .clang-format ] ; then
-
curl -o .clang-format "https://gitlab.cern.ch/lhcb-core/LbDevTools/raw/master/LbDevTools/data/default.clang-format?inline=false"
-
echo '.clang-format' >> .gitignore
...
...
This diff is collapsed.
Click to expand it.
doc/make_functor_docs.py
+
30
−
37
View file @
7a15ca74
...
...
@@ -44,14 +44,12 @@ def read_LoKi_To_ThOr_table(filename):
if
not
thor_name
:
continue
for
loki_name
in
loki_functors
:
mapping
.
append
(
{
"
loki_name
"
:
loki_name
,
"
thor_name
"
:
thor_name
,
"
equal_values
"
:
row
[
2
],
"
comment
"
:
row
[
3
],
}
)
mapping
.
append
({
"
loki_name
"
:
loki_name
,
"
thor_name
"
:
thor_name
,
"
equal_values
"
:
row
[
2
],
"
comment
"
:
row
[
3
],
})
assert
(
regex_parse_thor
.
match
(
thor_name
)
is
not
None
...
...
@@ -62,12 +60,10 @@ def read_LoKi_To_ThOr_table(filename):
def
LoKi_To_ThOr_mapping
():
standard_filename
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
selection/standard_loki_thor_table.csv
"
)
os
.
path
.
dirname
(
__file__
),
"
selection/standard_loki_thor_table.csv
"
)
array_filename
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
selection/array_loki_thor_table.csv
"
)
os
.
path
.
dirname
(
__file__
),
"
selection/array_loki_thor_table.csv
"
)
standard
=
read_LoKi_To_ThOr_table
(
standard_filename
)
array
=
read_LoKi_To_ThOr_table
(
array_filename
)
...
...
@@ -95,11 +91,9 @@ def generate_LoKiDoc(mapping, namespace, thor_name):
comment
=
entry
[
"
comment
"
].
strip
()
if
arguments_needed
is
not
None
:
comment
=
(
fr
"
:math:`\equiv` `
{
namespace
}
.
{
thortbl
}
"
f
"
(
{
arguments_needed
}
)`
"
+
(
"
--
"
+
comment
if
len
(
comment
)
>
0
else
""
)
)
comment
=
(
fr
"
:math:`\equiv` `
{
namespace
}
.
{
thortbl
}
"
f
"
(
{
arguments_needed
}
)`
"
+
(
"
--
"
+
comment
if
len
(
comment
)
>
0
else
""
))
elif
len
(
comment
)
>
0
:
comment
=
"
--
"
+
comment
...
...
@@ -160,35 +154,31 @@ def gen_docs(namespaces, ignore_names=[]):
if
hasattr
(
f
,
"
headers
"
)
and
hasattr
(
f
,
"
code
"
):
if
len
(
f
.
headers
())
!=
0
:
fmt_header
=
"
,
"
.
join
(
[
f
"
`
{
h
}
<
{
gitlab_link
}
/
{
h
}
>`_
"
for
h
in
f
.
headers
()]
)
[
f
"
`
{
h
}
<
{
gitlab_link
}
/
{
h
}
>`_
"
for
h
in
f
.
headers
()])
coderep
=
f
"
in
{
fmt_header
}
"
has_cppname
=
False
if
(
hasattr
(
f
,
"
_cppname
"
)
and
f
.
_cppname
is
not
None
and
len
(
f
.
_cppname
.
strip
())
!=
0
):
if
(
hasattr
(
f
,
"
_cppname
"
)
and
f
.
_cppname
is
not
None
and
len
(
f
.
_cppname
.
strip
())
!=
0
):
coderep
=
f
"
``
{
f
.
_cppname
}
``
"
+
(
coderep
if
coderep
is
not
None
else
""
)
coderep
if
coderep
is
not
None
else
""
)
has_cppname
=
True
if
hasattr
(
f
,
"
_code
"
)
and
f
.
_code
is
not
None
and
not
has_cppname
:
if
hasattr
(
f
,
"
_code
"
)
and
f
.
_code
is
not
None
and
not
has_cppname
:
coderep
=
f
"
``
{
f
.
_code
.
strip
()
}
``
"
+
(
coderep
if
coderep
is
not
None
else
""
)
coderep
if
coderep
is
not
None
else
""
)
# comma-separated list of argument names.
args
=
(
"
,
"
.
join
([
p
[
0
]
for
p
in
f
.
_arguments
])
if
hasattr
(
f
,
"
_arguments
"
)
else
""
)
print
(
f
"
:: generate
{
name
}
.
{
functor_name
}
(
{
args
}
)
"
,
file
=
sys
.
stderr
)
args
=
(
"
,
"
.
join
([
p
[
0
]
for
p
in
f
.
_arguments
])
if
hasattr
(
f
,
"
_arguments
"
)
else
""
)
print
(
f
"
:: generate
{
name
}
.
{
functor_name
}
(
{
args
}
)
"
,
file
=
sys
.
stderr
)
# Start writing the Sphinx function block for this functor.
print
(
f
"
.. py:function::
{
name
}
.
{
functor_name
}
(
{
args
}
)
\n
"
)
print
(
textwrap
.
indent
(
inspect
.
cleandoc
(
f
.
__doc__
),
"
"
*
4
,
lambda
_
:
True
))
print
(
textwrap
.
indent
(
inspect
.
cleandoc
(
f
.
__doc__
),
"
"
*
4
,
lambda
_
:
True
))
print
(
""
)
# If we have found the corresponding C++ header, let the reader
...
...
@@ -212,7 +202,10 @@ def gen_docs(namespaces, ignore_names=[]):
gen_docs
(
{
"
Functors
"
:
F
,
"
Functors.math
"
:
Fmath
},
{
"
Functors
"
:
F
,
"
Functors.math
"
:
Fmath
},
ignore_names
=
[
"
test_bit
"
,
"
top_level_namespace
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment