Validate content of NVMe specification
Project description
nvme-lint
nvme-lint
is a tool that uses Camelot-py and Poppler to validate tables in NVMe specification documents.
Getting started
Dependencies
On Debian these packages are required:
python
pip
poppler-utils
libgl1
Before you can start using nvme-lint
you must have pdftohtml
in your PATH.
Write the command pdftohtml -v
to verify that it is available.
Installation
- Install by running:
pip install nvme-lint
Usage
To validate a NVMe specification file run the command:
nvme-lint file_name
You can also run the tool directly from the source directory with the command:
python -m nvme_lint
How it works
nvme-lint will extract every table from a NVMe specification pdf file, unless a target- or ignore-file is provided. Afterwards, it will proceed to parse and validate the tables.
The flags for nvme-lint
are defined below:
usage: nvme-lint [-h] [-l LOG] [-i IGNORE] [-t TARGET] [-y] file
positional arguments:
file
The pdf file containing the tables to validate
options:
-h, --help
show this help message and exit
-l LOG, --log LOG
The logging level. Possible values in order of severity: DEBUG, INFO, WARNING, ERROR, CRITICAL
-i IGNORE, --ignore IGNORE
A .txt file containing figure numbers to ignore, each number should go on a separate line.
This file will be ignored if a target is specified
-t TARGET, --target TARGET
A .txt file containing figure numbers to validate, each number should go on a separate line.
If this file is specified only the figure numbers included will be validated
-y, --yaml
If this flag is set, the content of the tables will be written to 'output.yaml'
NOTE: If you have a file called `output.yaml` in the directory you call `nvme-lint` from, it will be overwritten
Validation
During the process nvme-lint
checks for the following:
Issue | Log message |
---|---|
Incorrect format for the table captions | Encountered a problem with the caption to Figure (figure number) |
Incorrect format of footnotes | (value) should be 'NOTES' |
Columns called 'bit' instead of 'bits' | 'bit' instead of 'bits' |
Columns called 'byte' instead of 'bytes' | 'byte' instead of 'bytes' |
Incorrect format for bit- and byte-ranges (n to m instead of m:n) | (bytes / bits) range is of the wrong format: (value) |
Hexadecimal values in bits- and bytes-columns | (bytes / bits) value is of the wrong type: (value) |
Incorrect ordering for bits- and bytes-columns | (bytes / bits) are in wrong order |
Incorrect ordering for bits- and bytes-ranges | (bytes / bits) range is in wrong order: (value) |
Overlapping bits or bytes | overlap of (bytes / bits) |
Holes in the bits or bytes | hole in (bytes / bits) |
Incorrect sum of bits or bytes (not a power of 2) | sum of (bytes / bits) is not a power of 2 |
Incorrect sum of bits for commands | bits doesn't sum up to (32 / 64) |
Logging
The messages from nvme-lint
will be outputted to the terminal and the file nvme-lint.log
.
This file is placed in $XDG_DATA_HOME/nvme-lint/
, if $XDG_DATA_HOME
is in the environment. Otherwise, it will be placed in ~/.local/share/nvme-lint/
.
License
All software contained within this repository is dual licensed under the GNU General Public License version 2 or later or the Apache-2.0 license. See COPYING and LICENSE for more information.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nvme-lint-0.1.5.tar.gz
.
File metadata
- Download URL: nvme-lint-0.1.5.tar.gz
- Upload date:
- Size: 26.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce958c81c608f1f6fba955b79197f60748fa03b50499158d2e7439bf6c24a8f1 |
|
MD5 | fe2e631553becca194e405f8114cf2d7 |
|
BLAKE2b-256 | 7c0d6bf375940b60c46d0b439e0b58ec5b3377a415f3ba5f041f8722b55e6eb7 |
File details
Details for the file nvme_lint-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: nvme_lint-0.1.5-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 419e8227e545e71be8abe75e726c018400404b1f7f4064e577ee20cf11b3ec37 |
|
MD5 | fdd5b5accd349105621c15fa551d91f2 |
|
BLAKE2b-256 | 3fa397315c8d4eb27b370c8733d6528cf2b62cbfd89c440ce054e6fd5b92b2dc |