Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for specifically excluding code owners on files and subfolders #177

Open
dusi opened this issue Oct 27, 2022 · 1 comment
Open

Comments

@dusi
Copy link

dusi commented Oct 27, 2022

Description

Based on GitHub's documentation it should be possible to exclude certain folders (subfolders) from having an owner.

# In this example, @octocat owns any file in the `/apps`
# directory in the root of your repository except for the `/apps/github`
# subdirectory, as its owners are left empty.
/apps/ @octocat
/apps/github
            ^^^ has no owner = will not require sign off on PRs

Now this is something that's not possible with codeowners-validator and I wonder if adding this would help in situations where you want to make exceptions for specific files or subfolders.

Reasons

Adding support for this would not only support GitHub's CODEOWNERS's specs but it would allow adding exceptions to certain subfolders or files that don't need to be signed-off on. An example could be auto-generated code or documentation within a module.

Example A - Exclude generated code from requiring sign-offs on PRs

.
└── ModuleA
    └── Implementation
        └── Foo.swift
    └── Generated
        └── Bar.swift

Then CODEOWNERS would exclude /ModuleA/Generated from code ownership

/ModuleA @userA
/ModuleA/Generated
                  ^^^ not owned by anyone (deliberate exception)

Example B - Exclude documentation from requiring sign-offs on PRs

.
└── ModuleB
    └── Implementation
        └── Foo.swift
    └── README.md

Then CODEOWNERS would exclude README.md from code ownership

/ModuleB @userB
/ModuleB/README.md
                  ^^^ not owned by anyone
@TansyArron
Copy link

Just bumping this up, as I've just run into this issue. While I'm not enthusiastic about githubs choice of syntax for excludes, I do think tools like this validator should support the documented usage.

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

No branches or pull requests

2 participants