Skip to content

Commit

Permalink
[docs] Explain how to use Sphinx and it's converter on the kernel
Browse files Browse the repository at this point in the history
- Sphinx documentation in report converter explains the usage
  of sphinx tool on kernel sources
- Sphinx is accessible from the main readme file and supported
  code analyzer file
- Sphinx updated in usage
- Fixed typo in kernel-doc documentation
  • Loading branch information
jay24rajput committed Nov 9, 2020
1 parent 6a93394 commit e18ce2d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ The following tools are supported:
| **TypeScript** | [TSLint](/tools/report-converter/README.md#tslint) |
| **Go** | [Golint](/tools/report-converter/README.md#golint) |
| **Markdown** | [Markdownlint](/tools/report-converter/README.md#markdownlint) |
| | [Sphinx](/tools/report-converter/Readme.md#sphinx) |


For details see
Expand Down
1 change: 1 addition & 0 deletions docs/supported_code_analyzers.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ CodeChecker result directory which can be stored to a CodeChecker server.
| | [Staticcheck](https://staticcheck.io/) ||
| | [go-critic](https://github.com/go-critic/go-critic) ||
| **Markdown** | [Markdownlint](https://github.com/markdownlint/markdownlint) ||
| | [Sphinx](https://github.com/sphinx-doc/sphinx) ||

## Clang Sanitizers
| Name | Support storage of analyzer results |
Expand Down
34 changes: 32 additions & 2 deletions tools/report-converter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ a CodeChecker server.
* [Coccinelle](#coccinelle)
* [Smatch](#smatch)
* [Kernel-Doc](#kernel-doc)
* [Sphinx](#sphinx)
* [License](#license)

## Install guide
Expand Down Expand Up @@ -57,7 +58,7 @@ optional arguments:
Currently supported output types are: asan, clang-
tidy, coccinelle, cppcheck, eslint, fbinfer, golint,
kernel-doc, msan, pyflakes, pylint, smatch, spotbugs,
tsan, tslint, ubsan.
sphinx, tsan, tslint, ubsan.
--meta [META [META ...]]
Metadata information which will be stored alongside
the run when the created report directory will be
Expand Down Expand Up @@ -95,6 +96,7 @@ Supported analyzers:
pylint - Pylint, https://www.pylint.org
smatch - smatch, https://repo.or.cz/w/smatch.git
spotbugs - spotbugs, https://spotbugs.github.io
sphinx - sphinx, https://github.com/sphinx-doc/sphinx
tsan - ThreadSanitizer, https://clang.llvm.org/docs/ThreadSanitizer.html
tslint - TSLint, https://palantir.github.io/tslint
ubsan - UndefinedBehaviorSanitizer, https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
Expand Down Expand Up @@ -465,12 +467,40 @@ make htmldocs 2>&1 | tee kernel-docs.out

# Use 'report-converter' to create a CodeChecker report directory from the
# analyzer result of Kernel-Doc
report-converter -t kernel-doc -o ./codechecker_kernel_doc_reports ./sphinx_output.out
report-converter -t kernel-doc -o ./codechecker_kernel_doc_reports ./kernel-docs.out

# Store the Kernel-Doc reports with CodeChecker.
CodeChecker store ./codechecker_kernel_doc_reports -n kernel-doc
```
## [Sphinx](https://github.com/sphinx-doc/sphinx)
[Sphinx](https://github.com/sphinx-doc/sphinx) Sphinx is a documentation generator
or a tool that translates a set of plain text source files into various output formats,
automatically producing cross-references, indices, etc.
The recommended way of running Sphinx is to redirect the output to a file and
give this file to the report converter tool.
The following example shows you how to run Sphinx on kernel sources
and store the results found by Sphinx to the CodeChecker database.
```sh
# Change Directory to your project
cd path/to/linux/kernel/repository

# Run Sphinx
# Note: The output of the following command will be both of sphinx and kernel-doc,
# but the parser will parse only sphinx output
make htmldocs 2>&1 | tee sphinx.out

# Use 'report-converter' to create a CodeChecker report directory from the
# analyzer result of Sphinx
report-converter -t kernel-doc -o ./codechecker_sphinx_reports ./sphinx.out

# Store the Sphinx reports with CodeChecker.
CodeChecker store ./codechecker_sphinx_reports -n sphinx
```
## License
The project is licensed under Apache License v2.0 with LLVM Exceptions.
Expand Down

0 comments on commit e18ce2d

Please sign in to comment.