Giter VIP home page Giter VIP logo

Comments (4)

peterdemin avatar peterdemin commented on May 24, 2024 1

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.

dudicoco avatar dudicoco commented on May 24, 2024 1

Hi @mszostok, any updates on this one?

from codeowners-validator.

mszostok avatar mszostok commented on May 24, 2024

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.

jeremycohen avatar jeremycohen commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.