Bug 455714 - Validation exclude rule for JS does not work
Summary: Validation exclude rule for JS does not work
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Server 2003
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-19 04:48 EST by Michel R CLA
Modified: 2018-11-22 17:32 EST (History)
4 users (show)

See Also:


Attachments
SELECT FILTER TYPE (12.14 KB, image/png)
2018-10-17 12:29 EDT, Simon Arame CLA
no flags Details
BROWSE FOLDER PATH (9.57 KB, image/png)
2018-10-17 12:29 EDT, Simon Arame CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michel R CLA 2014-12-19 04:48:18 EST
I have some 3rd party javascript file that does not validate. The code is broken but I don't want to see this in my project validation.

I try to exclude the folder from javascript validation but it does not work, the files are still validated.

Steps:
 - create a broken js file in some folder.
 - in Project / Properties / Validation, select only the "Client-side Javascript" validator to avoid any misunderstanding.

 - click Settings on this validator.
 - add Exclude Group
 - add Rule
 - click Folder or file name
 - try whatever here, nothing at all works.

Clean the project to start a build validation for example.

I tried to put the file name only, the file with the path, the folder name, the folder path, whatever, nothing works, I still get JavaScript problems on the "excluded" files or folders.

Also if ever it was working, it is not clear at all if the excluded thing would be the folder only, or also its subfolders, or any way to specify this.

Additional remark about this functionality: in the dialog, there is no way to type a folder path directly, the path is always taken as a file path, one must first click on the "Folder select" button, choose any folder, and then type the path, then it is taken as a folder. There should be a radio button to select "path is a folder" or accept a path with a trailing slash as folder!

But anyway since it does not work at all...

The interface for resource exclusion (from build) is much, much better designed, and it works!
Comment 1 Michel R CLA 2014-12-19 05:24:02 EST
The validation thing is crazy.

Since my project was a little bit specific, with linked folders and many files, I tried to create a test project for the case. The previous project was also created under a previous version of Eclipse.

The project is a "Dynamic Web Project". I created a folder and put a .js broken file.

Now this is the contrary, the js file will not be validated at all whatever I do!!!

I saw that in the other project is an option "Add Validation Builder" which is not here, it was not in older Eclipse.

I checked that option in the other project, now the options is not there in the validation options (I guess I must go to the "Builder" screen now to remove it) but now there is NO MORE js validation at all in this project either! Even with no exclude rule nothing is validated anymore.

Whatever is going on, I believe that it is not good at all, now I even can't say if some validations are missing or if there are some that should not be done!
Comment 2 Victor Rubezhny CLA 2015-03-12 09:02:45 EDT
Michel,

If some javascript isn't to be validated, why not to add it or its folder to the Exclusions in Project Properties -> Include Path -> <Source Path>: Excluded?

The any not excluded javascript in Include Path should be taken into account by the builder and as such the builder's parser will generate errors.

Client-side JavaScript validator's settings don't allow you to exclude a JavaScript file from the build/validation. They are for JavaScript code embeded for example, on an HTML page.
Comment 3 Michel R CLA 2015-03-16 06:04:05 EDT
Ok thank you Victor.

> Client-side JavaScript validator's settings don't allow you to exclude a
> JavaScript file from the build/validation. They are for JavaScript code
> embeded for example, on an HTML page.

This is an important clarification. This definition of "client side javascript" is quite restrictive. These javascript files are to be executed on the browser side, thus they are for me (and for Wikipedia as well: http://en.wikipedia.org/wiki/Client-side_scripting) "client side" scripts. Although this is not *embedded* client-side javascript.

I am not the only one who is mistaken by the term "client side javascript validation"...

Maybe at least adding "Embedded" (... client side validator) in the validators list would help.

> If some javascript isn't to be validated, why not to add it or its folder to
> the Exclusions in Project Properties -> Include Path -> <Source Path>:
> Excluded?
> 
> The any not excluded javascript in Include Path should be taken into account
> by the builder and as such the builder's parser will generate errors.
> 

Ok I see. I also understand why the js files where not at all validated in the second case, since I didn't put the js folder in the javascript sources path.

Thank you.

Michel
Comment 4 Gautier de SAINT MARTIN LACAZE CLA 2017-03-26 10:36:32 EDT
I want to add some other information about this issue. 

I create a JavaScript project in Eclipse 4.7 M6. I use npm and bower for my dependencies. 

When I validate my project, the .js files in "bower_components" are correctly excluded from the validation. But when a same file with errors is in node_modules folder, the exclude rule doesn't work. 

I also notice that JSON validation doesn't honorate the exclude rule.
Comment 5 Simon Arame CLA 2018-10-17 12:29:12 EDT
Created attachment 276288 [details]
SELECT FILTER TYPE
Comment 6 Simon Arame CLA 2018-10-17 12:29:46 EDT
Created attachment 276289 [details]
BROWSE FOLDER PATH
Comment 7 Simon Arame CLA 2018-10-17 12:33:35 EDT
(In reply to Gautier de SAINT MARTIN LACAZE from comment #4)
> I want to add some other information about this issue. 
> 
> I create a JavaScript project in Eclipse 4.7 M6. I use npm and bower for my
> dependencies. 
> 
> When I validate my project, the .js files in "bower_components" are
> correctly excluded from the validation. But when a same file with errors is
> in node_modules folder, the exclude rule doesn't work. 
> 
> I also notice that JSON validation doesn't honorate the exclude rule.

Similar issue here, the rules set that once was applied just ceased to be in effect even when they still exists in the Window>Preferences>Validation>[...] Rules set menu.

I observed that issue with WSDL, XML and JSON.
I observed that issue with Files and Folders.
ticking the "For file based comparisons, use only the simple file name." does not seem to change the validation result in terms of considering the rules set that cease to be effective.