I am using Sonar in a Angular Application for the front part.
I have many js files in my application, but i need that the Sonar ignore or exclusion my js files that ending in .spec.js, are tests unit of Angular.
I have many folders under "src/app" and inside i have many folders with the .spec.js files .
In the properties file to Sonar (sonar-project.properties), I think I can use:
sonar.test.exclusions=src/app/*.spec.js
or
sonar.exclusions=src/app/*.spec.js
But I'm not sure, in what format is the value of property.
Thanks,
Yes, you are correct. You can use the sonar.exclusions property to exclude source files from analysis and the sonar.test.exclusions property to exclude unit tests. You should pass a comma-delimited list of file path patterns to these properties.
I suggest you refer to this topic to learn how to specify path patterns. Say, if you need to exclude all the .spec.js files from all the src/app directories, use this pattern:
**/src/app/*.spec.js
I always use */*.jsand it works for me for file in main dir. So just use * or ** to navigate inside your project dir.
Related
I'm confused how "control" and "control.in" files works and what exactly is the difference between them.
I looked into a postgresql extension's debian folder and both files contains the same code, but the packaging build fails if I remove control.in.
I looked into the documentation of control fields but didn't get what I was looking for.
The "control" file is used by Debian package managers to specify the metadata and dependencies of a package. The "control.in" file is a template file used to generate the "control" file. It may contain variables that get replaced by values during the package build process. The package build may fail if "control.in" is removed because it is used to generate the final "control" file.
So upon further review, I found, as answered by #fahad-zaheer ,
Control.in serves as a template to build control file and after specifying the variables to make a generic control.in file which can be dynamic in nature,
We can create the control file by :
pg_buildext updatecontrol
This will look for control.in in the same directory, and will replace all the variable like postgreSQL-$Version with the value of $version by fetching from environment variable or if initialized in the control.in itself.
The main difference between the two is that "control.in" is a template file that gets processed during the packaging process to generate the final "control" file.
The reason why the build fails if you remove the "control.in" file is that it is used as a template to generate the "control" file, which is required for the package to be built and installed properly. The "control.in" file contains variables and placeholders that are replaced with actual values during the package building process, so it's essential to have it in place.
I'm using "react-i18next" to translate my Website and the translation files are in "/public/locales/{en|fr}/translation.json".
Problem: the files are cached and therefore when I update the translation values, the changes are not applied except if I clean my browser caches.
I guess, the solution is to add a hash in the name of these translation files during the start/build. This is what React already does for files in '/src' folder. How can I achieve that ? It seems that 'react-scripts start/build' abstract all the Webpack configuration.
You can host your translations on a dedicated path with the help of i18next-http-backend, like described here.
Alternatively, you could also make use of a professional CDN service like locize and fetch the translations via i18next-locize-backend, like described here.
I am using sencha cmd 6 for building my application.
my folder structure is
classic
src
model
view
account
jobs
portal
portal.js
controller
store
production build process execution is successful but when i load that build its giving .js file not found error.
So i include all js files in folder structure into main js portal.js then .js error is removed and build works.
But i dont want to include all these list of files in one single js, so can we skip the js include part from portal.js and use any property or attribute to include all js files ?
You can specify with * like 'Ext.chart.*' in requires section of Ext.app.Application.
Hope this helps.
I have used Swiip to scaffold app.Now I am trying to customize it. There are lots of unnecessary folders under src folder like components and I want to remove components folder.But there is no success.My console shows error
(index):62 GET http://localhost:3000/app/components/navbar/navbar.directive.js
(index):63 GET http://localhost:3000/app/components/githubContributor/githubContributor.service.js
I tried to find where is dependency of these files but no success.
As well if I comment everything then there is no error it means from somewhere these two files are getting called.
Swiip has an architecture and you should understand it for nice programming performance.
The folder Component should containe your features for example (navbar, customers, suppliers, ...) all your modules should be as a folder under component and each folder should containe all the files concerning this module(controller, html, service, directive) if you do so you won't need to reference your files it does it itself.
I hope that my answear helped you ... at all I can help anyTime
By default (in project's grunt file) the templates.js file located in .tmp directory (generator-backbone), so am I missing something or this feature just don't work out of the box and I need to put additional paths in require.config?
Obviously if I will not add anything the JST will not be defined, right?
Note that I initiated the projects with Handlebars as the templating framework.
Ah - sorry for trashing SO. Obviously I've messed up paths in my Grunt.js.
Only .tmp/scripts directory is mounted and I've added app to the path additionally, so the files was not served at all.