-
Notifications
You must be signed in to change notification settings - Fork 10
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 on files with syntax errors #1
Comments
I believe this is the same behavior as other linters like eslint for javascript. If the parser is unable to parse the file, I'm not sure how it would be able to lint it. Any thoughts on a possible solution? |
Currently the visitor checks for errors but I think it should just check if the fragment is not null. namespace TSQLLint.Tests.UnitTests.Parser
{
using System.IO;
using NUnit.Framework;
using TSQLLint.Lib.Parser;
[TestFixture]
public class FragmentBuilderTests
{
[Test]
public void TestError()
{
var file = new StringReader(@"
CREATE PROCEDURE proc1
,@param1 NVARCHAR(someConst) = null;
AS
return 0;
");
var builder = new FragmentBuilder();
var fragment = builder.GetFragment(file, out var errors);
Assert.AreNotEqual(0, errors.Count);
Assert.NotNull(fragment);
}
}
} |
Oh, I see, you're saying it would br some kind of change to the C# lib, not the extension, haha. I was super confused. So the repo and code for the lib is https://github.com/tsqllint/tsqllint if you want to open an issue (but a PR is even more ideal) 👍 |
Ok thanks, will do |
I noticed that if even one line of the file has a syntax error the whole file will be ommitted from linting checks.
The text was updated successfully, but these errors were encountered: