이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 5. Managing rules


The MTR plugin comes with a core set of System rules for analyzing projects and identifying migration and modernization issues.

You can create and import custom rulesets.

5.1. Viewing rules

You can view system and custom rules, if any, for the MTR plugin.

Prerequisites

  • To view system rules, the MTR server must be running.

Procedure

  1. Click the Rulesets tab.
  2. Expand System to view system rulesets or Custom to view custom rulesets.
  3. Expand a ruleset.
  4. Double-click a rule to open it in a viewer.
  5. Click the Source tab to view the XML source of the rule.

5.2. Creating a custom ruleset

You can create a custom ruleset in the MTR perspective.

See the Rule Development Guide to learn more about creating custom XML rules.

Procedure

  1. Click the Rulesets tab.
  2. Click the Create Ruleset icon ( Create ruleset icon ).
  3. Select a project and a directory for the ruleset.
  4. Enter the file name.

    Note

    The file must have the extension .windup.xml.

  5. Enter a ruleset ID, for example, my-ruleset-id.
  6. Optional: Select Generate quickstart template to add basic rule templates to the file.
  7. Click Finish.
  8. The ruleset file opens in an editor and you can add and edit rules in the file.
  9. Click the Source tab to edit the XML source of the ruleset file.

You can select the new ruleset when you create a run configuration.

5.3. Importing a custom ruleset

You can import a custom ruleset into the MTR plugin to analyze your projects.

Prerequisites

  • Custom ruleset file with a .windup.xml extension.

    See the Rule Development Guide for information about creating rulesets.

Procedure

  1. Click the Rulesets tab.
  2. Click the Import Ruleset icon ( Import ruleset icon ).
  3. Browse to and select the XML rule file to import.

    The custom ruleset is displayed when you expand Custom on the Rulesets tab.

5.4. Submitting a custom ruleset

You can submit your custom ruleset for inclusion in the official MTR rule repository. This allows your custom rules to be reviewed and included in subsequent releases of MTR.

Procedure

  1. Click the Rulesets tab.
  2. Click the Arrow icon ( Dropdown ) and select Submit Ruleset.
  3. Complete the following fields:

    • Summary: Describe the purpose of the rule. This becomes the title of the submission.
    • Code Sample: Enter an example of the source code that the rule should run against.
    • Description: Enter a brief description of the rule.
  4. Click Choose Files and select the ruleset file.
  5. Click Submit.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.