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

Trying to lint non-existing file or file with wrong extension results in exitCode=0 and no error (and dubious warning summary) #674

Closed
knocte opened this issue Jan 9, 2024 · 0 comments · Fixed by #677

Comments

@knocte
Copy link
Collaborator

knocte commented Jan 9, 2024

Repro steps

Please provide the steps required to reproduce the problem

  1. dotnet fsharplint lint nonExistantProjectFile.fsproj
    Result: Could not find the file: nonExistantProjectFile.fsproj on disk
    (exitCode != 0)
  2. dotnet fsharplint lint nonExistantFSharpFile.fs
    Result: Could not find the file: nonExistantFSharpFile.fs on disk
    (exitCode != 0)
  3. dotnet fsharplint lint nonExistantFileWithNoExtension
  4. dotnet fsharplint lint existingFileButNonFSharpFile.zip

Expected behavior

After step 3: it should print Could not find the file: nonExistantFileWithNoExtension on disk and (exitCode != 0)
After step 4: it should print File extension not recognised. Valid extensions: .fs, .fsx, .fsproj, .sln and (exitCode != 0)

Actual behavior (after step 3, and after step 4)

========== Linting /home/user/Dog.Test.fsx ==========
========== Finished: 0 warnings ==========
========== Summary: 0 warnings ==========

Known workarounds

Please provide a description of any known workarounds.

Related information

  • Version: 0.23.6
webwarrior-ws added a commit to webwarrior-ws/FSharpLint that referenced this issue Jan 9, 2024
Added tests for linting non-existent file and file with wrong
extension as described in [1].

[1] fsprojects#674
knocte pushed a commit that referenced this issue Jan 9, 2024
When linting source provided directly as command line argument,  change
displayed file name to `"<inline source>"` so it's clear that inline source is
being linted, rather than confusing `"/home/user/Dog.Test.fsx"`.

Closes #674
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

Successfully merging a pull request may close this issue.

1 participant