teemtee / tmt

Test Management Tool
MIT License
76 stars 112 forks source link

tmt-lint pre-commit doesn't work out of the box for manual tests #2867

Open lukaszachy opened 1 month ago

lukaszachy commented 1 month ago

Manual test cannot be linted by the pre-commit as we currently specify in the guide.

We advise:

repos:
- repo: https://github.com/teemtee/tmt.git
  rev: 1.32.1
  hooks:
  - id: tmt-lint

But tmt lint for manual tests needs tmt[test-convert] installed. Otherwise fails with fail T008 cannot open the manual test path: Install tmt+test-convert to export tests.

test-convert brings: "html2text>=2020.1.16", "markdown>=3.3.4", "nitrate>=1.8.2", "python-bugzilla>=3.2.0",

Out of those just markdown should be necessary, the rest is to convert nitrate test case into tmt format, so

One option is to install the hook as

repos:
- repo: https://github.com/teemtee/tmt.git
  rev: 1.32.1
  hooks:
  - id: tmt-lint
    additional_dependencies: ['markdown']

IMO we want to have 'tmt lint' work out of the box, right? How about adding 'markdown' (after making sure it is all we need) part of default dependencies?

If not acceptable: Is there a nicer way to make the hook install right package set, ideally defined in the repo/pypi, not as a enumaration in the hook file?

To test this one nees manual test, eg:

cat <<EOF > main.fmf
test: main.fmf
manual: true
EOF