Skip to content

Added pre-commit and CI - #5

Merged
heyufan1995 merged 6 commits into
mainfrom
jjomier/add_pre_commit
Feb 25, 2026
Merged

Added pre-commit and CI#5
heyufan1995 merged 6 commits into
mainfrom
jjomier/add_pre_commit

Conversation

@jjomier

@jjomier jjomier commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Added pre-commit script and fixing linting errors

@jjomier
jjomier requested a review from heyufan1995 February 25, 2026 18:20
@greptile-apps

greptile-apps Bot commented Feb 25, 2026

Copy link
Copy Markdown

Greptile Summary

Adds pre-commit hooks and CI workflow to enforce code quality standards, along with automated linting fixes across 46 files. The changes introduce ruff for Python linting/formatting and markdownlint for documentation, then apply those tools to fix existing style issues including import ordering, modern type hints, trailing whitespace, and markdown formatting.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All changes are automated linting/formatting fixes that don't alter logic. The new CI infrastructure follows best practices and will prevent future style inconsistencies
  • No files require special attention

Important Files Changed

Filename Overview
.pre-commit-config.yaml New pre-commit configuration with standard hooks for trailing whitespace, file formatting, YAML/JSON validation, ruff for Python linting/formatting, and markdownlint
.github/workflows/ci.yml New CI workflow that runs pre-commit checks on pushes and PRs to main branch
pyproject.toml New ruff configuration targeting Python 3.11, 150 char line length, standard linting rules with E501 ignored
.markdownlint.yaml New markdownlint configuration with relaxed line length (700 chars) to accommodate existing docs
README.md Formatting fixes: trailing whitespace removed, image syntax converted from HTML to markdown, blank lines normalized
NV-Segment-CT/scripts/trainer.py Import reordering per ruff standards (collections.abc imports separated from typing), minor line reformatting
NV-Segment-CTMR/brain_t1_preprocess/intensity_normalization/normalize/base.py Import reordering, modern type hints (typing.Optional →
NV-Segment-CT/docs/README.md Markdown formatting improvements: added blank lines between sections, improved link syntax, better heading hierarchy, code block language tags

Last reviewed commit: 5938a58

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

46 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Comment thread .pre-commit-config.yaml
@@ -0,0 +1,35 @@
# Pre-commit hooks for NV-Generate-CTMR

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment references NV-Generate-CTMR but the repository is nv-segment-ctmr

Suggested change
# Pre-commit hooks for NV-Generate-CTMR
# Pre-commit hooks for NV-Segment-CTMR

Comment thread .github/workflows/ci.yml Outdated
@@ -0,0 +1,26 @@
# CI for NV-Generate-CTMR: lint and format checks via pre-commit

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment references NV-Generate-CTMR but the repository is nv-segment-ctmr

Suggested change
# CI for NV-Generate-CTMR: lint and format checks via pre-commit
# CI for NV-Segment-CTMR: lint and format checks via pre-commit

Comment thread pyproject.toml
@@ -0,0 +1,13 @@
# Minimal config for tooling (pre-commit, ruff). NV-Generate-CTMR has no installable package.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment references NV-Generate-CTMR but the repository is nv-segment-ctmr

Suggested change
# Minimal config for tooling (pre-commit, ruff). NV-Generate-CTMR has no installable package.
# Minimal config for tooling (pre-commit, ruff). NV-Segment-CTMR has no installable package.

Comment thread .markdownlint.yaml
@@ -0,0 +1,7 @@
# Markdownlint config for NV-Generate-CTMR

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment references NV-Generate-CTMR but the repository is nv-segment-ctmr

Suggested change
# Markdownlint config for NV-Generate-CTMR
# Markdownlint config for NV-Segment-CTMR

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

46 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@heyufan1995
heyufan1995 merged commit c46f994 into main Feb 25, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants