Skip to content

Commit

Permalink
Merge pull request #396 from RedHatProductSecurity/rename-rule-transform
Browse files Browse the repository at this point in the history
chore: rename rule-transform to rules-transform
  • Loading branch information
qduanmu authored Dec 20, 2024
2 parents 0314389 + 226a0d2 commit bd39af8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2024 Red Hat, Inc.


"""Testing module for trestlebot rule-transform command"""
"""Testing module for trestlebot rules-transform command"""

import pathlib
from typing import Tuple
Expand All @@ -11,14 +11,14 @@
from git import Repo

from tests.testutils import setup_for_compdef, setup_rules_view
from trestlebot.cli.commands.rule_transform import rule_transform_cmd
from trestlebot.cli.commands.rules_transform import rules_transform_cmd


test_comp_name = "test_comp"
test_md = "md_cd"


def test_rule_transform(tmp_repo: Tuple[str, Repo]) -> None:
def test_rules_transform(tmp_repo: Tuple[str, Repo]) -> None:
"""Test rule transform."""
repo_path_str, repo = tmp_repo

Expand All @@ -31,7 +31,7 @@ def test_rule_transform(tmp_repo: Tuple[str, Repo]) -> None:

runner = CliRunner()
result = runner.invoke(
rule_transform_cmd,
rules_transform_cmd,
[
"--dry-run",
"--repo-path",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Red Hat, Inc.

"""Module for rule-transform command"""
"""Module for rules-transform command"""

import logging
from typing import Any, List
Expand All @@ -22,7 +22,7 @@


@click.command(
name="rule-transform",
name="rules-transform",
help="Transform rules to an OSCAL Component Definition JSON file.",
)
@click.pass_context
Expand All @@ -45,7 +45,7 @@
help="Comma-separated list of glob patterns for directories to skip when running tasks.",
)
@handle_exceptions
def rule_transform_cmd(ctx: click.Context, **kwargs: Any) -> None:
def rules_transform_cmd(ctx: click.Context, **kwargs: Any) -> None:
"""Run the rule transform operation."""
# Allow any model to be skipped by setting skip_item, by default include all
model_filter: ModelFilter = ModelFilter(
Expand Down
4 changes: 2 additions & 2 deletions trestlebot/cli/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from trestlebot.cli.commands.autosync import autosync_cmd
from trestlebot.cli.commands.create import create_cmd
from trestlebot.cli.commands.init import init_cmd
from trestlebot.cli.commands.rule_transform import rule_transform_cmd
from trestlebot.cli.commands.rules_transform import rules_transform_cmd
from trestlebot.cli.commands.sync_upstreams import sync_upstreams_cmd


Expand All @@ -32,5 +32,5 @@ def root_cmd(ctx: click.Context) -> None:
root_cmd.add_command(init_cmd)
root_cmd.add_command(autosync_cmd)
root_cmd.add_command(create_cmd)
root_cmd.add_command(rule_transform_cmd)
root_cmd.add_command(rules_transform_cmd)
root_cmd.add_command(sync_upstreams_cmd)

0 comments on commit bd39af8

Please sign in to comment.