Skip to content

Commit

Permalink
isort
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Henkel <[email protected]>
  • Loading branch information
ct2034 committed Jul 20, 2023
1 parent 730fdcc commit d70ea2f
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 38 deletions.
15 changes: 6 additions & 9 deletions src/ros_license_toolkit/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@
from pprint import pformat
from typing import Dict, List, Optional

from ros_license_toolkit.license_tag import is_license_name_in_spdx_list
from ros_license_toolkit.license_tag import LicenseTag
from ros_license_toolkit.package import get_spdx_license_name
from ros_license_toolkit.package import is_license_text_file
from ros_license_toolkit.package import Package
from ros_license_toolkit.package import PackageException
from ros_license_toolkit.ui_elements import green
from ros_license_toolkit.ui_elements import NO_REASON_STR
from ros_license_toolkit.ui_elements import red
from ros_license_toolkit.license_tag import (LicenseTag,
is_license_name_in_spdx_list)
from ros_license_toolkit.package import (Package, PackageException,
get_spdx_license_name,
is_license_text_file)
from ros_license_toolkit.ui_elements import NO_REASON_STR, green, red


class Check:
Expand Down
4 changes: 2 additions & 2 deletions src/ros_license_toolkit/license_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
license tags in package.xml files.
"""

from glob import glob
import os
from typing import List, Optional, Set
import xml.etree.ElementTree as ET
from glob import glob
from typing import List, Optional, Set

from spdx.config import LICENSE_MAP

Expand Down
19 changes: 7 additions & 12 deletions src/ros_license_toolkit/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,14 @@
import timeit
from typing import Optional, Sequence

from ros_license_toolkit.checks import LicensesInCodeCheck
from ros_license_toolkit.checks import LicenseTagExistsCheck
from ros_license_toolkit.checks import LicenseTagIsInSpdxListCheck
from ros_license_toolkit.checks import LicenseTextExistsCheck
from ros_license_toolkit.checks import (LicensesInCodeCheck,
LicenseTagExistsCheck,
LicenseTagIsInSpdxListCheck,
LicenseTextExistsCheck)
from ros_license_toolkit.package import get_packages_in_path
from ros_license_toolkit.ui_elements import FAILURE_STR
from ros_license_toolkit.ui_elements import green
from ros_license_toolkit.ui_elements import major_sep
from ros_license_toolkit.ui_elements import minor_sep
from ros_license_toolkit.ui_elements import red
from ros_license_toolkit.ui_elements import rll_print_factory
from ros_license_toolkit.ui_elements import SUCCESS_STR
from ros_license_toolkit.ui_elements import Verbosity
from ros_license_toolkit.ui_elements import (FAILURE_STR, SUCCESS_STR,
Verbosity, green, major_sep,
minor_sep, red, rll_print_factory)


def main(args: Optional[Sequence[str]] = None) -> int:
Expand Down
8 changes: 3 additions & 5 deletions src/ros_license_toolkit/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@
"""

import os
from typing import Any, Dict, List, Optional
import xml.etree.ElementTree as ET
from typing import Any, Dict, List, Optional

from rospkg import list_by_path
from rospkg import RosPack
from rospkg import RosPack, list_by_path
from rospkg.common import PACKAGE_FILE
from scancode.api import get_licenses

from ros_license_toolkit.common import is_license_text_file
from ros_license_toolkit.license_tag import LicenseTag
from ros_license_toolkit.repo import NotARepoError
from ros_license_toolkit.repo import Repo
from ros_license_toolkit.repo import NotARepoError, Repo

# files we ignore in scan results
IGNORED_FILES = [
Expand Down
3 changes: 1 addition & 2 deletions src/ros_license_toolkit/ui_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
This module contains UI elements for the CLI.
"""

from enum import auto
from enum import Enum
from enum import Enum, auto

# colors

Expand Down
3 changes: 1 addition & 2 deletions test/systemtest/test_license_per_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@

import os
import subprocess
from test.systemtest._test_helpers import make_repo
from test.systemtest._test_helpers import remove_repo
import unittest
from test.systemtest._test_helpers import make_repo, remove_repo


class TestLicensePerRepoBsd3(unittest.TestCase):
Expand Down
3 changes: 1 addition & 2 deletions test/systemtest/test_separate_pkgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@

import os
import subprocess
from test.systemtest._test_helpers import make_repo
from test.systemtest._test_helpers import remove_repo
import unittest
from test.systemtest._test_helpers import make_repo, remove_repo

from ros_license_toolkit.main import main

Expand Down
4 changes: 2 additions & 2 deletions test/unittest/test_license_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import unittest
from xml.etree import ElementTree as ET

from ros_license_toolkit.license_tag import is_license_name_in_spdx_list
from ros_license_toolkit.license_tag import LicenseTag
from ros_license_toolkit.license_tag import (LicenseTag,
is_license_name_in_spdx_list)


class TestChecks(unittest.TestCase):
Expand Down
3 changes: 1 addition & 2 deletions test/unittest/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

import git

from ros_license_toolkit.repo import NotARepoError
from ros_license_toolkit.repo import Repo
from ros_license_toolkit.repo import NotARepoError, Repo


class TestRepo(unittest.TestCase):
Expand Down

0 comments on commit d70ea2f

Please sign in to comment.