"text": "Metric Definitions"
}
],
- "extension_billing": [
- {
- "link": "/documentation/sonarcloud-pricing/",
- "text": "Pricing",
- "scope": "sonarcloud"
- }
- ],
- "global_permissions": [
- {
- "link": "/documentation/organizations/manage-team/",
- "text": "Manage a Team",
- "scope": "sonarcloud"
- }
- ],
+ "global_permissions": [],
"issues": [],
"marketplace": [],
- "organization_members": [
- {
- "link": "/documentation/organizations/manage-team/",
- "text": "Manage a Team",
- "scope": "sonarcloud"
- }
- ],
- "organization_projects": [
- {
- "link": "/documentation/organizations/manage-team/",
- "text": "Manage a Team",
- "scope": "sonarcloud"
- }
- ],
- "organization_space": [
- {
- "link": "/documentation/organizations/overview/",
- "text": "Organizations",
- "scope": "sonarcloud"
- }
- ],
"overview": [
{
"link": "/documentation/analysis/pull-request/",
{
"link": "/documentation/user-guide/clean-as-you-code/",
"text": "Clean as You Code"
+ },
+ {
+ "link": "/documentation/user-guide/connected-mode/",
+ "text": "SonarLint connected mode"
}
],
"permission_templates": [],
"text": "About Quality Profiles"
}
],
- "projects_management": [
- {
- "link": "/documentation/analysis/overview/",
- "text": "Analyze a Project",
- "scope": "sonarcloud"
- }
- ],
- "projects": [
- {
- "link": "/documentation/analysis/overview/",
- "text": "Analyze a Project",
- "scope": "sonarcloud"
- }
- ],
+ "projects_management": [],
+ "projects": [],
"pull_requests": [
{
"link": "/documentation/user-guide/clean-as-you-code/",
{
"link": "/documentation/analysis/pull-request/",
"text": "Analyzing Pull Requests"
+ },
+ {
+ "link": "/documentation/user-guide/connected-mode/",
+ "text": "SonarLint connected mode"
}
],
"quality_gates": [
],
"settings": [],
"system_info": [],
- "user_groups": [
- {
- "link": "/documentation/organizations/manage-team/",
- "text": "Manage a Team",
- "scope": "sonarcloud"
- }
- ],
+ "user_groups": [],
"users": [],
"webhooks": [
{
it('should have valid links in suggestions file', () => {
const file = 'EmbedDocsSuggestions.json';
const suggestions = JSON.parse(fs.readFileSync(path.join(rootPath, file), 'utf8'));
- let hasErrors = false;
- Object.keys(suggestions).forEach(key => {
- suggestions[key].forEach(suggestion => {
+ const hasErrors = Object.keys(suggestions).some(key => {
+ return suggestions[key].some(suggestion => {
if (!suggestion.link.startsWith('/documentation/')) {
- console.log(`[${suggestion.link}] should starts with "/documentation/", in ${file}`);
- hasErrors = true;
- } else if (!urlExists(parsedFiles, suggestion.link.replace('/documentation', ''))) {
+ console.log(
+ `[${suggestion.link}] should starts with "/documentation/" or be a valid url, in ${file}`
+ );
+ return true;
+ }
+ if (!urlExists(parsedFiles, suggestion.link.replace('/documentation', ''))) {
console.log(`[${suggestion.link}] is not a valid link, in ${file}`);
- hasErrors = true;
+ return true;
}
+ return false;
});
});
expect(hasErrors).toBe(false);