Skip to content

Commit d0c3cd9

Browse files
committed
Add an initial validator for FIT
This comprises a generic FDT validator and an initial schema for FIT. Both are incomplete, but this is a good starting point for completing the validator.
1 parent d0cdf44 commit d0c3cd9

File tree

9 files changed

+1011
-0
lines changed

9 files changed

+1011
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Build output
22
build/
3+
4+
__pycache__

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ latexdiff: latex
3434
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
3535
%: Makefile
3636
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
37+
38+
check:
39+
python validate/fit_validate_test.py
40+
pylint validate/*.py

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,28 @@ Make commands:
8282
8383
Output goes in ./build subdirectory.
8484
85+
## FIT Validation ##
86+
87+
A simple validator is included to check FIT-format files. This is
88+
work-in-progress, in that it does not include the full schema.
89+
90+
To use it:
91+
92+
>```
93+
>pip install dtoc
94+
>validate/fit_validate.py <filename>
95+
>'''
96+
97+
where <filename> is the FIT file to validate.
98+
99+
The files are as follows:
100+
101+
* fit_validate.py - FIT validator
102+
* fdt_validate.py - Generic devicetree validator
103+
* schema.py - FIT schema
104+
* elements.py - Generic elements used by the schema
105+
* fit_validate_test.py - tests for the FIT validator
106+
85107
## License ##
86108
This project is licensed under the Apache V2 license. More information can be found
87109
in the LICENSE and NOTICE file or online at:

validate/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)