Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pre-commit #741

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@ jobs:
- test-conda-nightly-env
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: pre-commit/[email protected]
build:
needs: checks
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
test-conda-nightly-env:
needs: checks
secrets: inherit
# We use a build workflow so that we get CPU jobs and high matrix coverage
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
Expand Down
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# Copyright (c) 2025, NVIDIA CORPORATION.

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: end-of-file-fixer
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.3
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v0.5.0
hooks:
- id: verify-copyright
4 changes: 2 additions & 2 deletions ci/check_conda_nightly_env.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
import json
import re
import subprocess
import sys
from datetime import datetime, timedelta

Expand Down Expand Up @@ -139,7 +139,7 @@ def check_env(json_path):

if __name__ == "__main__":
if len(sys.argv) != 2:
print("Provide only one argument, the filepath to a JSON output from " "conda.")
print("Provide only one argument, the filepath to a JSON output from conda.")
sys.exit(1)

sys.exit(check_env(sys.argv[1]))
Loading