openfpga-validator
v0.7.0
Published
Script which validates OpenFPGA core zips
Downloads
7
Maintainers
Readme
openfpga-validator
Script which validates OpenFPGA core zips
Usage
To run, do:
npx openfpga-validator@latest check <path_to_zip>
(you'll need node installed but after that it'll be a 1 line thing)
It'll return the errors, warnings, & recommendations
Can check for more options with
npx openfpga-validator@lastest check --help
Adding checks
If you want to add a check then:
- Raise an issue (with examples of fail / pass criterion) & I'll get to it eventually
Or, if you want to do it yourself
- if it doesn't fit into one of the files which already exist in the
src/checks
folder then create a new one - export a function of the type
CheckFn
- decide on the level:
- If it would break on the Pocket itself, or goes against a
must
in the Analogue Docs, then it's anerror
- If it would probably break an updater, or cause a user to have to do extra work, but doesn't go against anything in the Analogue Docs it's a
warning
- If it's just nice to have - or it's a convention followed by other cores - then it's a
Recommendation
- If it would break on the Pocket itself, or goes against a
- If you can specify the part of the Analogue Docs which talk about the issue then include the URL in the message
- add an
await
for it to the mainindex.ts
- Add a "good" example to the
good
folder intest_zips
and a "bad" example in thebad
one - run
npm test -- -u
to update the snapshots within the tests & check they look as expected - Raise a PR, I'll merge, bump the version, and do a release
To run locally
Doing
npm run run check <path_to_zip>
Will build the TS files & run it as if a user's done npx openfpga-validator check <path_to_zip>