[SONARLINT][JAVASCRIPT] GET FILENAME OF CURRENT SCANNING FILE`

19 views
Skip to first unread message

mahima...@gmail.com

unread,
Oct 24, 2016, 3:07:22 AM10/24/16
to SonarLint
Hi All,

I'm trying to implement custom rules for somarlint javascript. I have added few custom rules.

I have a requirement in js rules(Rules class) that I want to know name and path of the file which is being scanned.

Is there any way to get this information. Any pointers will be helpful.


Thanks,
RaJ 

Pierre-Yves Nicolas

unread,
Oct 24, 2016, 4:03:15 AM10/24/16
to mahima...@gmail.com, SonarLint
Hi,

In your check class, you can write getContext().getFile() to retrieve the file which is analysed, for example:

Regards,
Pierre-Yves

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/b4e5f5f5-836a-410f-9632-2725109212d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mahima raju

unread,
Oct 28, 2016, 11:38:51 PM10/28/16
to Pierre-Yves Nicolas, SonarLint
Thanks for the Input.It worked like a charm :) 
Reply all
Reply to author
Forward
0 new messages