Details
-
New Feature
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
This is a suggestion for yet another new standard rule.
"require Files not checked in"
While there are already rules "require files don't exist" and "require file size", this one would check wether files are actually checked in or added into the current VCS.
E.g. for each file in the pattern:
- check if they are added (git, bzr) or checked in (cvs, svn, bzr, git)
- If so, fail the build.
configurable options:
- files (like the other two checks, ant pattern)
- failOnAdd (git, bzr): true by default, can be set to false. Then the check will only fail if files are currently in a commit.
- useDefaultExclusions: Read exclusion rules from VCS (git: .gitignore, svn: svn:ignore, etc.). However, files could have been forcibly added in git. So maybe this doesn't make much sense
- skip
- ..?
The idea is to prevent developers from accidentally check in big files (like jar files, zip files) or other binary artifacts. While this could be spotted in a PR, the repo might already be spoiled and enlarged by this size, which is usually not feasible.
Alternatives:
- use "files don't exist" and exclude target (may not work for everyone)
- use a shell script
- don't implement this rule and leave the task to others.