From d5f550265ef4bfafb36be596326a067c8b913bf3 Mon Sep 17 00:00:00 2001 From: ajs256 <67526318+ajs256@users.noreply.github.com> Date: Sun, 22 Nov 2020 10:30:14 -0800 Subject: [PATCH 1/4] Fix #1407 Say that a CODEOWNERS file follows most, but not all, gitignore syntax rules --- .../about-code-owners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md b/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md index 732c4043188c..db75ac1ee4dc 100644 --- a/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md +++ b/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md @@ -39,7 +39,7 @@ For code owners to receive review requests, the CODEOWNERS file must be on the b ### CODEOWNERS syntax -A CODEOWNERS file uses a pattern that follows the same rules used in [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) files. The pattern is followed by one or more {% data variables.product.prodname_dotcom %} usernames or team names using the standard `@username` or `@org/team-name` format. You can also refer to a user by an email address that has been added to their {% data variables.product.product_name %} account, for example `user@example.com`. +A CODEOWNERS file uses a pattern that follows most of the same rules used in [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) files. The pattern is followed by one or more {% data variables.product.prodname_dotcom %} usernames or team names using the standard `@username` or `@org/team-name` format. You can also refer to a user by an email address that has been added to their {% data variables.product.product_name %} account, for example `user@example.com`. If any line in your CODEOWNERS file contains invalid syntax, the file will not be detected and will not be used to request reviews. Invalid syntax includes inline comments and user or team names that do not exist on {% data variables.product.product_name %}. #### Example of a CODEOWNERS file From 33f9910aa449c9b299da75c875defd498dce2816 Mon Sep 17 00:00:00 2001 From: ajs256 <67526318+ajs256@users.noreply.github.com> Date: Wed, 9 Dec 2020 10:23:06 -0800 Subject: [PATCH 2/4] More updates See https://github.com/github/docs/issues/1407#issuecomment-741943838 --- .../about-code-owners.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md b/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md index db75ac1ee4dc..b204cf19d634 100644 --- a/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md +++ b/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md @@ -39,9 +39,9 @@ For code owners to receive review requests, the CODEOWNERS file must be on the b ### CODEOWNERS syntax -A CODEOWNERS file uses a pattern that follows most of the same rules used in [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) files. The pattern is followed by one or more {% data variables.product.prodname_dotcom %} usernames or team names using the standard `@username` or `@org/team-name` format. You can also refer to a user by an email address that has been added to their {% data variables.product.product_name %} account, for example `user@example.com`. +A CODEOWNERS file uses a pattern that follows most of the same rules used in [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) files, with [some exceptions].(#syntax-exceptions). The pattern is followed by one or more {% data variables.product.prodname_dotcom %} usernames or team names using the standard `@username` or `@org/team-name` format. You can also refer to a user by an email address that has been added to their {% data variables.product.product_name %} account, for example `user@example.com`. -If any line in your CODEOWNERS file contains invalid syntax, the file will not be detected and will not be used to request reviews. Invalid syntax includes inline comments and user or team names that do not exist on {% data variables.product.product_name %}. +If any line in your CODEOWNERS file contains invalid syntax, the file will not be detected and will not be used to request reviews. #### Example of a CODEOWNERS file ``` # This is a comment. @@ -83,6 +83,13 @@ apps/ @octocat # subdirectories. /docs/ @doctocat ``` +#### Syntax exceptions +There are some syntax rules for .gitignore files that do not work in CODEOWNERS files: +- Escaping a pattern starting with `#` using `\` so it is treated as a pattern and not a comment +- Using `!` to negate a pattern +- Using `[ ]` to define a character range + + ### Further reading From 9ed4b314fc02f29114b5cc479128a9bd986eda46 Mon Sep 17 00:00:00 2001 From: ajs256 <67526318+ajs256@users.noreply.github.com> Date: Wed, 9 Dec 2020 14:13:52 -0800 Subject: [PATCH 3/4] Fix link syntax oops! --- .../about-code-owners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md b/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md index b204cf19d634..70a6bef2f5a0 100644 --- a/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md +++ b/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md @@ -39,7 +39,7 @@ For code owners to receive review requests, the CODEOWNERS file must be on the b ### CODEOWNERS syntax -A CODEOWNERS file uses a pattern that follows most of the same rules used in [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) files, with [some exceptions].(#syntax-exceptions). The pattern is followed by one or more {% data variables.product.prodname_dotcom %} usernames or team names using the standard `@username` or `@org/team-name` format. You can also refer to a user by an email address that has been added to their {% data variables.product.product_name %} account, for example `user@example.com`. +A CODEOWNERS file uses a pattern that follows most of the same rules used in [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) files, with [some exceptions](#syntax-exceptions). The pattern is followed by one or more {% data variables.product.prodname_dotcom %} usernames or team names using the standard `@username` or `@org/team-name` format. You can also refer to a user by an email address that has been added to their {% data variables.product.product_name %} account, for example `user@example.com`. If any line in your CODEOWNERS file contains invalid syntax, the file will not be detected and will not be used to request reviews. #### Example of a CODEOWNERS file From d2ba4f1bf87f92788e4e4ecaead8dfd4ac6c11dd Mon Sep 17 00:00:00 2001 From: ajs256 <67526318+ajs256@users.noreply.github.com> Date: Thu, 10 Dec 2020 09:31:35 -0800 Subject: [PATCH 4/4] Update content/github/creating-cloning-and-archiving-repositories/about-code-owners.md Co-authored-by: hubwriter --- .../about-code-owners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md b/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md index 70a6bef2f5a0..fb66821ca26c 100644 --- a/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md +++ b/content/github/creating-cloning-and-archiving-repositories/about-code-owners.md @@ -84,7 +84,7 @@ apps/ @octocat /docs/ @doctocat ``` #### Syntax exceptions -There are some syntax rules for .gitignore files that do not work in CODEOWNERS files: +There are some syntax rules for gitignore files that do not work in CODEOWNERS files: - Escaping a pattern starting with `#` using `\` so it is treated as a pattern and not a comment - Using `!` to negate a pattern - Using `[ ]` to define a character range