Skip to content

Commit

Permalink
Linting: Don't run on excluded files. #638
Browse files Browse the repository at this point in the history
  • Loading branch information
madskristensen committed Feb 11, 2014
1 parent 4776764 commit 30e75e0
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public void VsTextViewCreated(IVsTextView textViewAdapter)
ITextDocument document;
if (TextDocumentFactoryService.TryGetTextDocument(textView.TextDataModel.DocumentBuffer, out document))
{
if (ProjectHelpers.GetProjectItem(document.FilePath) == null)
return;

var jsHintLintInvoker = new LintFileInvoker(f => new JavaScriptLintReporter(new JsHintCompiler(), f), document);
textView.Closed += (s, e) => jsHintLintInvoker.Dispose();

Expand Down

1 comment on commit 30e75e0

@ChrisTorng
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my Make JavaScript ignore rule better #636.

For EditorExtensions/Commands/LintFileInvoker.cs#L63, RunOnAllFilesInProjectAsync() will only run on build, and #L72 have exclude non project items.

For run on save or right click menu item on non-project items, they can be done explicit by user. So I remove the limit from (Combine JsHint and JSCS rule, hack to stop errors #637) 'ShouldIgnore()` at https://github.com/madskristensen/WebEssentials2013/pull/637/files#diff-5455f829157714ebe561d9289a2170ceL43.

Please sign in to comment.