-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1250 from ErikDanielsson/modules-lint-docs
Add automated docs for `nf-core modules lint`
- Loading branch information
Showing
19 changed files
with
160 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Module lint tests | ||
|
||
```{toctree} | ||
:caption: 'Tests:' | ||
:glob: true | ||
:maxdepth: 2 | ||
* | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# main_nf | ||
|
||
```{eval-rst} | ||
.. automethod:: nf_core.modules.lint.ModuleLint.main_nf | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# meta_yml | ||
|
||
```{eval-rst} | ||
.. automethod:: nf_core.modules.lint.ModuleLint.meta_yml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# module_deprecations | ||
|
||
```{eval-rst} | ||
.. automethod:: nf_core.modules.lint.ModuleLint.module_deprecations | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# module_todos | ||
|
||
```{eval-rst} | ||
.. automethod:: nf_core.modules.lint.ModuleLint.module_todos | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Pipline lint tests | ||
# Pipeline lint tests | ||
|
||
```{toctree} | ||
:caption: 'Tests:' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env python | ||
|
||
import fnmatch | ||
import os | ||
import nf_core.lint | ||
import nf_core.modules.lint | ||
|
||
|
||
def make_docs(docs_basedir, lint_tests, md_template): | ||
# Get list of existing .md files | ||
existing_docs = [] | ||
for fn in os.listdir(docs_basedir): | ||
if fnmatch.fnmatch(fn, "*.md") and not fnmatch.fnmatch(fn, "index.md"): | ||
existing_docs.append(os.path.join(docs_basedir, fn)) | ||
|
||
for test_name in lint_tests: | ||
fn = os.path.join(docs_basedir, "{}.md".format(test_name)) | ||
if os.path.exists(fn): | ||
existing_docs.remove(fn) | ||
else: | ||
with open(fn, "w") as fh: | ||
fh.write(md_template.format(test_name)) | ||
print(test_name) | ||
|
||
for fn in existing_docs: | ||
os.remove(fn) | ||
|
||
|
||
# Create the pipeline docs | ||
pipeline_docs_basedir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "_src", "pipeline_lint_tests") | ||
make_docs( | ||
pipeline_docs_basedir, | ||
nf_core.lint.PipelineLint._get_all_lint_tests(True), | ||
"""# {0} | ||
```{{eval-rst}} | ||
.. automethod:: nf_core.lint.PipelineLint.{0} | ||
``` | ||
""", | ||
) | ||
|
||
# Create the modules lint docs | ||
modules_docs_basedir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "_src", "module_lint_tests") | ||
make_docs( | ||
modules_docs_basedir, | ||
nf_core.modules.lint.ModuleLint._get_all_lint_tests(), | ||
"""# {0} | ||
```{{eval-rst}} | ||
.. automethod:: nf_core.modules.lint.ModuleLint.{0} | ||
``` | ||
""", | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters