Skip to content

Conversation

@joseph5wu
Copy link
Contributor

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

Meta internally is using these basic linter by default.
This will make it easy for any FBOSS OSS user to fix these basic linter issues before creating a pull request, which will make it easier for FBOSS team to import a PR without manually fixing the linter later.

Test Plan

Manually add an empty line at the end of a file to violate the end-of-file-fixer hook check. As you can see from below, it will fix it automatically.

$ git diff                           
diff --git i/.pre-commit-config.yaml w/.pre-commit-config.yaml
index 83c45806b1..6d10834c45 100644
--- i/.pre-commit-config.yaml
+++ w/.pre-commit-config.yaml
@@ -15,3 +15,4 @@ repos:
       - id: check-yaml
       - id: check-json
       - id: check-merge-conflict
+
$ git add .                             
$ pre-commit run               
clang-format.........................................(no files to check)Skipped
trim trailing whitespace.................................................Passed
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing .pre-commit-config.yaml

check yaml...............................................................Passed
check json...........................................(no files to check)Skipped
check for merge conflicts................................................Passed
$ git status                          
On branch oss_pre_commit
Changes to be committed:
	modified:   .pre-commit-config.yaml

Changes not staged for commit:
	modified:   .pre-commit-config.yaml

$ git diff                
diff --git i/.pre-commit-config.yaml w/.pre-commit-config.yaml
index 6d10834c45..83c45806b1 100644
--- i/.pre-commit-config.yaml
+++ w/.pre-commit-config.yaml
@@ -15,4 +15,3 @@ repos:
       - id: check-yaml
       - id: check-json
       - id: check-merge-conflict
-
$ git add .                           
$ git status                            
On branch oss_pre_commit
Changes to be committed:
	modified:   .pre-commit-config.yaml

@joseph5wu joseph5wu self-assigned this Oct 29, 2025
@meta-cla meta-cla bot added the CLA Signed label Oct 29, 2025
@meta-codesync
Copy link

meta-codesync bot commented Oct 30, 2025

@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D85819265.

@meta-codesync
Copy link

meta-codesync bot commented Oct 30, 2025

@joseph5wu merged this pull request in 3974d3e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants