Skip to content

error with forward slashes in linter plugin on windows #3963

Description

@sprogma

I wanted to create custom linter for my file format, and found that linter plugin doesn't support "/" in file paths on windows (matches %f in linter format string)

I think it's because of basename function (in runtime/plugins/linter/linter.lua), where sep is defined as "\\" on windows. Perhaps it should be "[/\\]"?


This error doesn't happen with default C linters since clang and gcc don't change path format, so

clang a/b\c/../c/d.c -fsyntax-only

produces same pattern, and basename matches:

a/b\c/../c/d.c:1:1 error: ...

But i think some other linters can normalize path in error messages (as my linter does).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions