Comments (4)
I don't like our setup, because we don't have control over which version to use. I still put it here so others could avoid our mistakes:
We use gh
CLI to figure out binary management:
gh extension install mszostok/gh-validate-codeowners
.pre-commit-config.yaml
:
- id: verify_codeowners
name: verify_codeowners
entry: tools/validate_codeowners.sh
language: script
files: CODEOWNERS
tools/validate_codeowners.sh
:
env REPOSITORY_PATH="." CHECKS="syntax,files,duppatterns" gh validate-codeowners
from codeowners-validator.
Hi @mszostok, any updates on this one?
from codeowners-validator.
Hi @peterdemin and @jeremycohen!
You both posted that the pre-commit support would be nice to see in codeowners-validator.
Do you already have snippets on how you use it with pre-commit? I see, one problem that the CLI supports for now only env variables, where pre-commit allows only flags. For example:
- repo: https://github.com/path/to/your/hook/repo
rev: badf00ddeadbeef
hooks:
- id: my-hook-script-id
args: [--myarg1=1, --myarg1=2]
Additionally, you want to use the docker_image, go or system option? The last option, AFAIK, the bin needs to be preinstalled.
from codeowners-validator.
Sorry I didn't get back sooner. Here's roughly how we currently use this script to look for unowned files in a specific subdirectory:
REPOSITORY_PATH=... EXPERIMENTAL_CHECKS="notowned" NOT_OWNED_CHECKER_SKIP_PATTERNS=... CHECKS="files,duppatterns,syntax" NOT_OWNED_CHECKER_SUBDIRECTORIES=... ./bin/codeowners-validator
We don't have a precommit hook yet for this, but I would guess it would look like @peterdemin's setup if we were to do so (lower-pri item for us, not typically a common error to hit for devs).
from codeowners-validator.
Related Issues (20)
- Periodically validate if GitHub is case-insensitive for teams and orgs names
- Comments in CODEOWNERS
- notowned with an empty codeowners file HOT 1
- Validate GitHub token scopes when `owners` check is enabled
- Valid Owner Checker should report if the owner doesn't have Write access HOT 1
- App authentication doesn't work with provided action HOT 10
- /folder/* wildcard pattern is assumed to be nested by the action "Not Owned" check, which it isnt HOT 1
- CODEOWNERS file existence check HOT 1
- Unnecessary failure of test of GitHub token
- Killed: 9 HOT 8
- Error and mismatched URLs when using github app credentials via github enterprise
- Add support for specifically excluding code owners on files and subfolders HOT 1
- Recommended App permissions don't appear to be sufficient
- codeowners-validator install.sh crit-platform error for linux/arm64
- Print a list of all files and their owners HOT 1
- Owner child team is not supported by codeowners-validator
- Executing File Exist Checker Not support glob
- Feature request: fail for deleted files that are explicitly owned in CODEOWNERS HOT 4
- Support Gitea codeowners
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeowners-validator.