Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Commit 3edd04d

Browse files
authored
Merge pull request #26 from NVIDIA-NeMo/pablo-garay/rufF_linting
feat: ruff for linting
2 parents 9d74ab1 + 7db3bdc commit 3edd04d

37 files changed

Lines changed: 113 additions & 92 deletions

File tree

.github/workflows/changelog-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
type: string
1717
required: false
1818
default: ''
19-
19+
2020
jobs:
2121
changelog:
2222
runs-on: ubuntu-latest
@@ -41,7 +41,7 @@ jobs:
4141
toTag: ${{ inputs.release-branch }}
4242

4343
- name: Update changelog file
44-
env:
44+
env:
4545
RELEASE_BRANCH: ${{ inputs.release-branch }}
4646
CHANGELOG: ${{ steps.github_tag.outputs.changelog }}
4747
MAIN_CONTENT: ${{ inputs.changelog-main-content }}

.github/workflows/cicd-approve-test-queue.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,3 @@ jobs:
150150
-H 'Content-type: application/json' \
151151
--data "{\"text\":\":robot_joy: <https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}|Test-queue-approval-bot workflow> failed. Please review manually.\n\ncc ${SLACK_WEBHOOK_ADMIN}\"}" \
152152
$SLACK_WEBHOOK
153-

.github/workflows/ruff.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Ruff Linter
16+
on: pull_request
17+
jobs:
18+
ruff:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: astral-sh/ruff-action@v3
23+
with:
24+
version: 0.11.4
25+
args: "check --output-format=github"

.pre-commit-config.yaml

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,53 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
default_language_version:
16+
python: python3
17+
18+
ci:
19+
autofix_prs: false
20+
autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
21+
autoupdate_schedule: quarterly
22+
23+
default_install_hook_types: [pre-commit, commit-msg]
24+
1525
repos:
1626
- repo: https://github.com/pre-commit/pre-commit-hooks
17-
rev: v4.4.0
27+
rev: v5.0.0
1828
hooks:
19-
- id: end-of-file-fixer
20-
# only include python files
21-
files: \.py$
22-
- id: trailing-whitespace
23-
# only include python files
24-
files: \.py$
29+
- id: check-added-large-files
30+
args: ['--maxkb=1000']
31+
- id: check-case-conflict
32+
- id: check-yaml
33+
- id: detect-private-key
34+
- id: end-of-file-fixer
35+
exclude: docs/
36+
- id: requirements-txt-fixer
37+
- id: trailing-whitespace
2538

2639
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: "v0.9.9" # Use the appropriate version
40+
rev: v0.11.4
41+
hooks:
42+
# Run the linter
43+
- id: ruff
44+
args: [--fix] # Enables auto-fixing lint errors
45+
# Run the formatter
46+
- id: ruff-format
47+
48+
- repo: local
2849
hooks:
29-
- id: ruff
30-
args: ["--fix"]
31-
- id: ruff
32-
args: ["check", "--select", "I", "--fix"]
33-
- id: ruff-format
50+
- id: check-signoff
51+
name: Check Signed-off-by
52+
entry: bash -c 'if ! grep -q "Signed-off-by:" "$1"; then echo "❌ Commit message must be signed off. Use git commit -s to add it automatically."; exit 1; fi' --
53+
language: system
54+
always_run: true
55+
stages: [commit-msg]
56+
types: [text]
3457

35-
# - repo: local
36-
# hooks:
37-
# - id: no-underscore-md
38-
# name: "Disallow '_' in Markdown filenames"
39-
# language: system
40-
# entry: |
41-
# bash -c '
42-
# # Report the offending files
43-
# echo "[pre-commit] ERROR: Found Markdown files with underscores:" >&2
44-
# for file in "$@"; do
45-
# echo " - $file (use hyphens instead)" >&2
46-
# done
47-
# exit 1
48-
# '
49-
# files: '.*\/[^\/]*_[^\/]*\.md$'
50-
# exclude: '^\.github/'
51-
# types: [file]
58+
- id: pre-commit-reminder
59+
name: Pre-commit Installation Reminder
60+
entry: echo "⚠️ Remember to install pre-commit and hooks (pip install pre-commit && pre-commit install --install-hooks)"
61+
language: system
62+
always_run: true
63+
pass_filenames: false
64+
stages: [pre-commit]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ If you find our code useful, please consider citing the following papers:
2727
journal={arXiv preprint arXiv:2501.03575},
2828
year={2025}
2929
}
30-
```
30+
```

dfm/examples/Automodel/finetune/wan2_1_t2v_flow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ checkpoint:
5656
checkpoint_dir: /opt/DFM/wan_t2v_flow_outputs_base_recipe_fsdp_run_1/
5757
model_save_format: torch_save
5858
save_consolidated: false
59-
restore_from: null
59+
restore_from: null

dfm/examples/Automodel/finetune/wan2_1_t2v_flow_multinode.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ checkpoint:
5656
checkpoint_dir: /opt/DFM/wan_t2v_flow_outputs_base_recipe_multi_node_fsdp_run_3/
5757
model_save_format: torch_save
5858
save_consolidated: false
59-
restore_from: null
59+
restore_from: null

dfm/src/Automodel/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Automodel
22

33
Models implemented using Dtensors (NeMo Automodel)
4-

dfm/src/megatron/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# MBridge
22

33
Megatron models including DiT and dLLM implementations.
4-

dfm/src/megatron/base/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Base
22

33
Base classes and interfaces for Megatron models.
4-

0 commit comments

Comments
 (0)