Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cli/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#
"""
Audits a SonarQube platform
Audits a SonarQube platform
"""

import sys
import json
import csv
Expand Down
3 changes: 2 additions & 1 deletion cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Exports SonarQube platform configuration as JSON
Exports SonarQube platform configuration as JSON
"""

from typing import TextIO
from threading import Thread
from queue import Queue
Expand Down
6 changes: 3 additions & 3 deletions cli/cust_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
This script manipulates custom measures. You may:
This script manipulates custom measures. You may:
Update a custom measure value:
Usage: cust_measures.py -t <SQ_TOKEN> -u <SQ_URL> -k <projectKey> -m <metricKey> --updateValue <value>
Update a custom measure value:
Usage: cust_measures.py -t <SQ_TOKEN> -u <SQ_URL> -k <projectKey> -m <metricKey> --updateValue <value>
"""

import sys
Expand Down
4 changes: 2 additions & 2 deletions cli/findings_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
This script exports findings as CSV, JSON, or SARIF
This script exports findings as CSV, JSON, or SARIF
Usage: sonar-findings-export.py -t <SQ_TOKEN> -u <SQ_URL> [<filters>]
Usage: sonar-findings-export.py -t <SQ_TOKEN> -u <SQ_URL> [<filters>]
"""

Expand Down
12 changes: 6 additions & 6 deletions cli/findings_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
This script propagates the manual issue changes (FP, WF, Change
of severity, of issue type, comments) from:
- One project to another (normally on different platforms but not necessarily).
The 2 platform don't need to be identical in version, edition or plugins
- One branch of a project to another branch of the same project (normally LLBs)
This script propagates the manual issue changes (FP, WF, Change
of severity, of issue type, comments) from:
- One project to another (normally on different platforms but not necessarily).
The 2 platform don't need to be identical in version, edition or plugins
- One branch of a project to another branch of the same project (normally LLBs)
Only issues with a 100% match are synchronized. When there's a doubt, nothing is done
Only issues with a 100% match are synchronized. When there's a doubt, nothing is done
"""

import datetime
Expand Down
9 changes: 5 additions & 4 deletions cli/housekeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
#
"""
Removes obsolete data from SonarQube platform
Currently:
- projects, branches, PR not analyzed since a given number of days
- Tokens not renewed since a given number of days
Removes obsolete data from SonarQube platform
Currently:
- projects, branches, PR not analyzed since a given number of days
- Tokens not renewed since a given number of days
"""

import sys

from requests import RequestException
Expand Down
3 changes: 2 additions & 1 deletion cli/loc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Exports LoC per projects
Exports LoC per projects
"""

import sys
import csv
import datetime
Expand Down
9 changes: 5 additions & 4 deletions cli/measures_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Exports some measures of all projects
- Either all measures (-m _all)
- Or the main measures (-m _main)
- Or a custom selection of measures (-m <measure1,measure2,measure3...>)
Exports some measures of all projects
- Either all measures (-m _all)
- Or the main measures (-m _main)
- Or a custom selection of measures (-m <measure1,measure2,measure3...>)
"""

import sys
import csv
from requests import RequestException
Expand Down
2 changes: 1 addition & 1 deletion cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
"""
Cmd line options
Cmd line options
"""

Expand Down
2 changes: 1 addition & 1 deletion cli/projects_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
"""
Exports/Imports all projects of a SonarQube Server platform
Exports/Imports all projects of a SonarQube Server platform
"""

Expand Down
3 changes: 2 additions & 1 deletion cli/projects_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#
"""
Exports all projects of a SonarQube platform
Exports all projects of a SonarQube platform
"""

import sys
from unittest.mock import patch

Expand Down
3 changes: 2 additions & 1 deletion cli/projects_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#
"""
Imports a list of projects to a SonarQube platform
Imports a list of projects to a SonarQube platform
"""

import sys
from unittest.mock import patch

Expand Down
3 changes: 2 additions & 1 deletion cli/rules_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Exports rules
Exports rules
"""

import sys
import csv

Expand Down
3 changes: 2 additions & 1 deletion cli/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#
"""
Audits a SUPPORT ticket SIF
Audits a SUPPORT ticket SIF
"""

from http import HTTPStatus
import sys
import os
Expand Down
3 changes: 2 additions & 1 deletion conf/ruff2sonar.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#
"""
Converts Ruff report format to Sonar external issues format
Converts Ruff report format to Sonar external issues format
"""

import sys
import json
import re
Expand Down
3 changes: 2 additions & 1 deletion conf/shellcheck2sonar.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#
"""
Converts shellcheck JSON format to Sonar external issues format
Converts shellcheck JSON format to Sonar external issues format
"""

import sys
import json

Expand Down
4 changes: 2 additions & 2 deletions conf/trivy2sonar.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#
"""
Converts Trivy JSON format to Sonar external issues format
Converts Trivy JSON format to Sonar external issues format
"""

import sys
import json

Expand All @@ -40,7 +41,6 @@ def main() -> None:
issue_list = {}

for issue in json.loads(text)["Results"][0]["Vulnerabilities"]:

sonar_issue = {
"ruleId": f"{TOOLNAME}:{issue['VulnerabilityID']}",
"effortMinutes": 30,
Expand Down
2 changes: 1 addition & 1 deletion migration/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Exports SonarQube platform configuration as JSON
Exports SonarQube platform configuration as JSON
"""

from cli import options, config
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@

"""
Package setup
Package setup
"""

import setuptools
from sonar import version

Expand Down
3 changes: 2 additions & 1 deletion setup_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@

"""
Package setup
Package setup
"""

import setuptools
from sonar import version

Expand Down
2 changes: 1 addition & 1 deletion sonar/aggregations.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
"""
Parent module of applications and portfolios
Parent module of applications and portfolios
"""

Expand Down
2 changes: 1 addition & 1 deletion sonar/app_branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#

""" Abstraction of Sonar Application Branch """
"""Abstraction of Sonar Application Branch"""

from __future__ import annotations
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions sonar/audit/audit_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#

"""sonar-config CLI"""

import os
import pathlib
import jprops
Expand Down
1 change: 1 addition & 0 deletions sonar/audit/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#

"""Abstraction of the audit rule concept"""

import enum
import json
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions sonar/audit/severities.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#

"""Sonar Audit severities"""

import enum
from typing import Optional

Expand Down
3 changes: 2 additions & 1 deletion sonar/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
#
"""
Abstraction of the SonarQube "component" concept
Abstraction of the SonarQube "component" concept
"""

from __future__ import annotations
from typing import Optional
import math
Expand Down
3 changes: 2 additions & 1 deletion sonar/custom_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
#
"""
Abstraction of the SonarQube "custom measure" concept
Abstraction of the SonarQube "custom measure" concept
"""

import json
import sonar.sqobject as sq
import sonar.platform as pf
Expand Down
2 changes: 1 addition & 1 deletion sonar/dce/app_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
"""
Abstraction of the App Node concept
Abstraction of the App Node concept
"""

Expand Down
2 changes: 1 addition & 1 deletion sonar/dce/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
"""
Abstraction of the DCE Node concept
Abstraction of the DCE Node concept
"""

Expand Down
2 changes: 1 addition & 1 deletion sonar/dce/search_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
"""
Abstraction of the Search Node concept
Abstraction of the Search Node concept
"""

Expand Down
1 change: 1 addition & 0 deletions sonar/devops.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#

"""Abstraction of the SonarQube DevOps platform concept"""

from __future__ import annotations
from typing import Optional, Union
from http import HTTPStatus
Expand Down
1 change: 1 addition & 0 deletions sonar/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
Exceptions raised but the sonar python APIs
"""

from sonar import errcodes


Expand Down
1 change: 1 addition & 0 deletions sonar/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

"""Abstraction of the SonarQube group concept"""

from __future__ import annotations
import json

Expand Down
1 change: 1 addition & 0 deletions sonar/languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

"""Abstraction of the SonarQube language concept"""

from __future__ import annotations

import json
Expand Down
2 changes: 1 addition & 1 deletion sonar/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
""" sonar-tools logging module """
"""sonar-tools logging module"""

import logging

Expand Down
1 change: 1 addition & 0 deletions sonar/measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#

"""Abstraction of the SonarQube measure concept"""

from __future__ import annotations

import json
Expand Down
Loading