Can SonarQube analyse my project if it has files with .sah extension - sonarqube

I need to analyse my project using sonar qube. It contains files with .sah extension but basically those .sah files contains javascript code.
I can analyse those files if i change files extensions from .sah to .js but its not a good way .
Is there a way with which I can analyse my code without changing extension from *.sah to *.js
Thanks..

.sah uses the standard JS syntax. You should be able to analyse sah files with the JavaScript plugin.
Add the following line in your sonar-project.properties:
sonar.javascript.file.suffixes=.js,.sah

You can also set sonar.javascript.file.suffixes in the SonarQube UI, either globally or for a specific project.
The screenshot below shows the global setting.
You can either navigate through the UI to find the page, or use following URLs:
global: http://your_SQServer/admin/settings?category=javascript
project level: http://your_SQServer/project/settings?category=javascript&id=your_project_id

Related

How to analyse .ejs files in Sonarqube

I have an app that uses ejs to render web pages and serve them via express.
I'm using a local instance of sonarqube to analyse the app.
By default the behavior is simply to ignore all .ejs files.
I'd like .ejs files to be analysed.
If this isn't supported I'd at least like to have them be included in the project statistics. I tried adding .ejs as an extension of .html files but it just explodes the number of errors because of missing tags which are rendered at runtime by ejs.
Is there any way to include them in the project cleanly ?
Actually, I think that if SonarQube can't handle the file (doesn't have any plugin that can analyze it), it has no interest in computing any metrics on it.

c# DocFx. Direct way to create the web page or pdf of documentation?

I have my visual studio 2022 project with c# and I want to create the documentation but I don't want more files and folders to my project.
Docfx create folders and files.
SandCastle you even have to create another project inside your solution.
There is a way to run a command and generate the web page without creating any extra file in the project/solution?
Thanks.
If you are just wanting to generate documentation from your source code xml comments than DocFx does not require that many new files to be be checked into source control. Sure you will need the basic project structure but all the intermediate / generated files in the output can be excluded from your committed source code using .gitignore files (assuming you are using git).
For example, in these tutorials
https://dotnet.github.io/docfx/tutorial/walkthrough/walkthrough_create_a_docfx_project_2.html
https://dotnet.github.io/docfx/tutorial/walkthrough/walkthrough_create_a_docfx_project.html
You would only really need
docfx.json
index.md
toc.yml
api/index.md
api.index.yml
.gitignore
If you add the following lines to the generated .gitignore from tutorial 1 then all the intermediate and generated documentation yml files will never be committed to git.
api/*.yml
api/.manifest
Hopefully this helps, I know it does not get you 0 extra files like you asked but its a fairly light weight solution to generating api documentation.

How can I find function usage in files other than go?

I am using a custom language (antha) which gets transpiled to go.
Antha script files end in .an and get transpiled to.go
I have a function in a .go file and I want to find its usages in .an files.
How do change the "find usage" feature of Gogland to include the .an files? Currently it only searches in the .go transpiled scripts.
A language plugin that understands antha would need to be created / installed in order for that feature to work, otherwise the IDE has no way to understand how to make that feature work. If you wish to learn about plugin development for IntelliJ Platform, you can start here.

Running chutzpah on server and in Visual Studio using different projects

I'm having several projects containing my javascript sources and one project containing my javascript tests. Now I'm wondering how to set my references in the test files to make them work in Visual Studio and the automated integration build on server side. The challenge is that the file struture differs in both locations.
Locally (Visual Studio) there is the usual file structure:
project-a/
content/scripts/library-x.js
tests-project/
tests/library-x-test.js
I set a reference in library-test-js which looks like this and works fine in VS:
/// <reference path="../../project-a/content/scripts/library-x.js" />
On server side everything is copied to the build output folder what changes the file structure to look like this:
build-folder/library-x-test.js
build-folder/content/scripts/library-x.js
The reference in library-x-test.js doesn't work anymore there. Any ideas how to solve this issue?
You should use the chutzpah.json file to configure your file paths instead of the reference comments. The chutzpah.json file give you more control and lets you use wild cards. Path's in the chutzpah.json file are relative to the location of that file so you are sometimes able to make things work in both build and local as long as you place that file correctly.

Adding syntax highlighter to JamWiki-1.2

The tutorial http://sinnerinc22.blogspot.de/2010/07/adding-syntax-highlighter-to-jamwiki.html describes how to enable syntax highlighting in JAMWiki.
My problem is that in the recent version of JAMWiki v1.2 the two files to be modified WEB-INF/jsp/top.jsp and WEB-INF/jsp/close-document.jsp do not exist any longer...
There is a third-party syntax highlighting tag extension available with JAMWiki 1.2 link that may work for you
I have added SHJS to my installation just following SHJS instructions rather than JAMWiki instructions. Simply edit JAMWiki JSP pages to add content as documented here. To see how does it work, look into the source code of this HTML document.
You even do not need to compile anything after you edit JSP, the server does this for you automatically.
Following up on Audrius's answer, here's exactly what you need to modify.
./jamwiki.war/WEB-INF/jsp/topic.jsp Modify it to look like this
Download the SHJS zip and copy all of the individual files from ./css/, ./lang/, ./sh_main.js, and ./sh_style.css from the zip to JamWiki.war/shjs/. (This will flatten the directory structure so everything is now in ./shjs/. Flattening the structure is optional but it makes for easier paths when referencing them in the jsp.)
You can modify the .war with 7zip or dig into your web app container file system and place the JSP and shjs folder directly.
Redeploy or refresh as needed depending on your preferred edit method.

Resources