Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad command/path generation on Windows #26

Open
Aryndel opened this issue Feb 1, 2023 · 1 comment
Open

Bad command/path generation on Windows #26

Aryndel opened this issue Feb 1, 2023 · 1 comment

Comments

@Aryndel
Copy link

Aryndel commented Feb 1, 2023

I am using this extension on VS Code in Windows with gherkin-lint and am having some issues. If I look at the output, I get something like this:

Language id: cucumber
Matching linters: [
"gherkin-lint"
]
Reading from cache? false
Linter config: {
"capabilities": [],
"command": [
"gherkin-lint",
"--config",
"$config",
"--format",
"json",
"$file"
],
"configFiles": [
".gherkin-lintrc"
],
"enabled": true,
"languages": [
"cucumber"
],
"name": "gherkin-lint",
"url": "https://github.com/vsiakka/gherkin-lint"
}
Args: {
"$rootDir": "c:\Projects\AyaHealthcare\Applications\QaAutomation",
"$file": "/c:/Projects/AyaHealthcare/Applications/QaAutomation/cypress/e2e/smoke/travelx/ticketing-smoke-tests.feature",
"$extension": ".feature",
"$extensionBare": "feature",
"$config": "c:\Projects\AyaHealthcare\Applications\QaAutomation\.gherkin-lintrc",
"$debug": false,
"$lint": true,
"$language": "cucumber",
"$shebang": ""
}
{
"rootDir": "c:\Projects\AyaHealthcare\Applications\QaAutomation",
"configFile": "c:\Projects\AyaHealthcare\Applications\QaAutomation\.gherkin-lintrc",
"command": [
"gherkin-lint",
"--config",
"c:\Projects\AyaHealthcare\Applications\QaAutomation\.gherkin-lintrc",
"--format",
"json",
"/c:/Projects/AyaHealthcare/Applications/QaAutomation/cypress/e2e/smoke/travelx/ticketing-smoke-tests.feature"
]
}
Error while running "gherkin-lint": spawnSync gherkin-lint ENOENT
gherkin-lint's command took 37ms

Just trying to throw things at the wall and see what would stick, I customized the command used in my settings.json so that it would add the .cmd extension to it, and that does cause it to at least no longer return the error running the command.

"linter.linters": {
"gherkin-lint": {
"command": [
"gherkin-lint.cmd",
"--config",
"$config",
"--format",
"json",
"$file"
]
}
},

But it doesn't return any issues, even if there are issues reported running gherkin-lint directly. I noticed the $file path generated always seems to have a / at the beginning, and I'm thinking perhaps that's causing a problem?

Language id: cucumber
Matching linters: [
"gherkin-lint"
]
Reading from cache? false
Linter config: {
"capabilities": [],
"command": [
"gherkin-lint.cmd",
"--config",
"$config",
"--format",
"json",
"$file"
],
"configFiles": [
".gherkin-lintrc"
],
"enabled": true,
"languages": [
"cucumber"
],
"name": "gherkin-lint",
"url": "https://github.com/vsiakka/gherkin-lint"
}
Args: {
"$rootDir": "c:\Projects\AyaHealthcare\Applications\QaAutomation",
"$file": "/c:/Projects/AyaHealthcare/Applications/QaAutomation/cypress/e2e/smoke/travelx/ticketing-smoke-tests.feature",
"$extension": ".feature",
"$extensionBare": "feature",
"$config": "c:\Projects\AyaHealthcare\Applications\QaAutomation\.gherkin-lintrc",
"$debug": false,
"$lint": true,
"$language": "cucumber",
"$shebang": ""
}
{
"rootDir": "c:\Projects\AyaHealthcare\Applications\QaAutomation",
"configFile": "c:\Projects\AyaHealthcare\Applications\QaAutomation\.gherkin-lintrc",
"command": [
"gherkin-lint.cmd",
"--config",
"c:\Projects\AyaHealthcare\Applications\QaAutomation\.gherkin-lintrc",
"--format",
"json",
"/c:/Projects/AyaHealthcare/Applications/QaAutomation/cypress/e2e/smoke/travelx/ticketing-smoke-tests.feature"
]
}
gherkin-lint's command took 493ms

If I run the command exactly as it is laid out in the output directly in my terminal, but without that slash at the beginning of the file path, gherkin-lint runs successfully and returns the list of issues:

gherkin-lint.cmd --config c:\Projects\AyaHealthcare\Applications\QaAutomation.gherkin-lintrc --format json c:/Projects/AyaHealthcare/Applications/QaAutomation/cypress/e2e/smoke/travelx/ticketing-smoke-tests.feature
[{"filePath":"c:\Projects\AyaHealthcare\Applications\QaAutomation\cypress\e2e\smoke\travelx\ticketing-smoke-tests.feature","errors":[{"message":"Missing Feature name","rule":"no-unnamed-features","line":1},{"message":"Forbidden tag @Focus on Scenario","rule":"no-restricted-tags","line":3}]}]

@JoseSandovalR
Copy link

JoseSandovalR commented Jun 22, 2023

My dear @Aryndel ,
could you solve the problem?
If you were able to solve it, would you provide me with the solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants