Skip to content

Commit 92955cc

Browse files
authored
Adopt ruff in CI (#5)
* Dropping pylint, isort and flake8 in favor of ruff ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/NeMo-Agent-Toolkit/blob/develop/docs/source/resources/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. ## Summary by CodeRabbit - Chores - Migrated linting to Ruff and updated pre-commit hooks for a streamlined developer workflow. - Removed legacy lint/format tools and configurations to reduce maintenance overhead. - Style - Standardized code style and import ordering via Ruff, with a 120-character line length. - Refactor - Minor internal script cleanup to use in-place list updates, with no behavioral changes. No user-facing features or behavior changes. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Will Killian (https://github.com/willkill07) URL: #5
1 parent e2087de commit 92955cc

5 files changed

Lines changed: 223 additions & 994 deletions

File tree

.pre-commit-config.yaml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,20 @@
1414
# limitations under the License.
1515

1616
repos:
17-
- repo: https://github.com/PyCQA/isort
18-
rev: 5.12.0
19-
hooks:
20-
- id: isort
21-
args: ["--filter-files", "--settings-file=./pyproject.toml"]
22-
23-
- repo: https://github.com/PyCQA/flake8
24-
rev: 7.0.0
25-
hooks:
26-
- id: flake8
27-
entry: pflake8
28-
additional_dependencies: [pyproject-flake8]
29-
args: ["--config=./pyproject.toml"]
3017

3118
- repo: https://github.com/google/yapf
3219
rev: v0.43.0
3320
hooks:
3421
- id: yapf
3522
args: ["-i", "--style", "./pyproject.toml"]
3623

24+
- repo: https://github.com/astral-sh/ruff-pre-commit
25+
rev: v0.12.9
26+
hooks:
27+
# Run the linter.
28+
- id: ruff-check
29+
args: [ --fix ]
30+
3731
- repo: https://github.com/astral-sh/uv-pre-commit
3832
rev: 0.6.2
3933
hooks:

ci/scripts/copyright.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ def _main():
237237
logging.basicConfig(format="%(levelname)s:%(message)s", level=log_level)
238238

239239
ret_val = 0
240-
global ExemptFiles
241240

242241
argparser = argparse.ArgumentParser("Checks for a consistent copyright header in git's modified files")
243242
argparser.add_argument("--update-start-year",
@@ -322,7 +321,7 @@ def _main():
322321

323322
(args, dirs) = argparser.parse_known_args()
324323
try:
325-
ExemptFiles = ExemptFiles + [re.compile(pathName) for pathName in args.exclude]
324+
ExemptFiles.extend([re.compile(pathName) for pathName in args.exclude])
326325
except re.error as re_exception:
327326
logger.exception("Regular expression error: %s", re_exception, exc_info=True)
328327
return 1

ci/scripts/gitutils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ def get_merge_target():
390390
str
391391
Ref name of the target branch
392392
"""
393-
#
394393

395394
remote_branch = GithubWrapper.get_pr_target_remote_branch()
396395

0 commit comments

Comments
 (0)