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

Linting LICENSE in a project directory #365

Open
geozeke opened this issue Jan 22, 2025 · 1 comment
Open

Linting LICENSE in a project directory #365

geozeke opened this issue Jan 22, 2025 · 1 comment
Labels

Comments

@geozeke
Copy link

geozeke commented Jan 22, 2025

Thanks for all the hard work on the awesome tool!

This one is oddly specific.

I'm using vscode, and I have a python project with LICENSE file. I added a .markdownlint.json file to the project directory to disable MD033, which works fine. However, markdownlint is now linting my LICENSE file, suggesting a MD041 violation. If I delete .markdownlint.json, then it stops linting the LICENSE.

Here are the glob patterns set in the vscode plugin:

**/*.{md,mkd,mdwn,mdown,markdown,markdn,mdtxt,mdtext,workbook}
!**/*.code-search
!**/bower_components
!**/node_modules
!**/.git
!**/vendor

If I put any other files in the project directory, without a file extension (e.g. TESTFILE), no issues are reported. If I give my LICENSE file a .txt extension, no issues are reported. It only happens when I have a .markdownlint.json file and a LICENSE file.

@DavidAnson DavidAnson transferred this issue from DavidAnson/markdownlint Jan 22, 2025
@DavidAnson
Copy link
Owner

I'm not sure why it's behaving like that, but this extension only lints files that VS Code tells it are Markdown. When you have a file open, there is a section in the bottom right of the window that shows what file type VS Code thinks it is. If you can figure out why VS Code sometimes thinks your license file is Markdown, you may be able to stop it doing that. Otherwise, you could specifically add that file to the ignore list, either via a configuration file or user settings. Which reminds me, user settings are only applied if a project configuration file does not exist, so that may explain why the behavior you see varies. all of that said, this does not sound like an extension bug as it is only doing what the editor tells it.

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

No branches or pull requests

2 participants