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

markdown-markdownlint-cli checker fails with "suspicious state" #1990

Open
aguynamedben opened this issue Dec 22, 2022 · 1 comment
Open

Comments

@aguynamedben
Copy link

I can't get the markdown-markdown-cli checker working. It seems like flycheck finds the linter, runs it as I'd expect, but then may have some kind of issue interpreting the output. I've read the troubleshooting guide and provided all the debug output below. Any help is appreciated.

🙏 Thank you so much for working on flycheck, I love it!

Error

I'm attempting to use the markdown-markdown-cli checker, but it's giving this error:

Suspicious state from syntax checker markdown-markdownlint-cli: Flycheck checker markdown-markdownlint-cli returned 1, but its output contained no errors: /Users/standefer/.config/yarn/global/node_modules/ignore/index.js:379
  throw new Ctor(message)
  ^

RangeError: path should be a `path.relative()`d string, but got "../../../../var/folders/bh/c53gkgbj7498ds7c4cn2l0840000gq/T/flycheckh0hWzp/CHANGELOG.md"
    at throwError (/Users/standefer/.config/yarn/global/node_modules/ignore/index.js:379:9)
    at checkPath (/Users/standefer/.config/yarn/global/node_modules/ignore/index.js:398:12)
    at Ignore._test (/Users/standefer/.config/yarn/global/node_modules/ignore/index.js:519:5)
    at Ignore.ignores (/Users/standefer/.config/yarn/global/node_modules/ignore/index.js:564:17)
    at ignoreFilter (/Users/standefer/.config/yarn/global/node_modules/markdownlint-cli/markdownlint.js:252:46)
    at /Users/standefer/.config/yarn/global/node_modules/markdownlint-cli/markdownlint.js:255:81
    at Array.filter (<anonymous>)
    at Object.<anonymous> (/Users/standefer/.config/yarn/global/node_modules/markdownlint-cli/markdownlint.js:255:65)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)

M-x flycheck-verify-setup

First checker to run:

  markdown-markdownlint-cli
    - may enable:         yes
    - executable:         Found at /usr/local/bin/markdownlint
    - configuration file: Not found

Checkers that are compatible with this mode, but will not run until properly configured:

  markdown-mdl (automatically disabled) reset
    - may enable:         no
    - executable:         Not found
    - configuration file: Not found

  proselint (automatically disabled) reset
    - may enable: no
    - executable: Not found

  textlint (automatically disabled) reset
    - may enable:         no
    - executable:         Not found
    - configuration file: Not found
    - textlint plugin:    @textlint/markdown

Flycheck Mode is enabled. Use C-u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 33snapshot (package: 20221213.107)
Emacs version:    28.2
System:           x86_64-apple-darwin18.7.0
Window system:    ns

markdownlint-cli version

$ /usr/local/bin/markdownlint --version
0.32.2

M-x flycheck-compile

The linter errors with CHANGELOG.md are what I'd expect given the state of my code.

-*- mode: compilation; default-directory: "~/code/tesla/" -*-
Compilation started at Wed Dec 21 16:04:31

/usr/local/bin/markdownlint /Users/standefer/code/tesla/CHANGELOG.md
/Users/standefer/code/tesla/CHANGELOG.md:28 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
/Users/standefer/code/tesla/CHANGELOG.md:29 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 3]
/Users/standefer/code/tesla/CHANGELOG.md:30 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 4]
/Users/standefer/code/tesla/CHANGELOG.md:31 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 5]

Compilation exited abnormally with code 1 at Wed Dec 21 16:04:31

Emacs version

GNU Emacs for Mac OS X - Version 28.2

M-x emacs-version gives:

GNU Emacs 28.2 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95)) of 2022-09-12
@aguynamedben aguynamedben changed the title markdown-markdownlint-cli suspicious state markdown-markdownlint-cli checker fails with "suspicious state" Dec 22, 2022
@aguynamedben
Copy link
Author

aguynamedben commented Dec 22, 2022

It seems the behavior of /usr/local/bin/markdownlint is to give a non-zero RC when there are linting problems, but maybe Flycheck is interpreting the non-zero RC as a problem executing linting?

When I remove the offending code, M-x flycheck-compile runs successfully and seems to be happy. In both cases, the call to run /usr/local/bin/markdownlint is being made as I'd expect, but maybe Flycheck is interpreting the output in a way I wouldn't expect.

(M-x flycheck-compile, with no linter problems in the code)

-*- mode: compilation; default-directory: "~/code/tesla/" -*-
Compilation started at Wed Dec 21 16:11:21

/usr/local/bin/markdownlint /Users/standefer/code/tesla/CHANGELOG.md

Compilation finished at Wed Dec 21 16:11:21

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

No branches or pull requests

1 participant