@ -14,7 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License .
limitations under the License .
* /
* /
/ * Package ignore provides tools for writing ignore files ( a la . gitignore ) .
/ *
Package ignore provides tools for writing ignore files ( a la . gitignore ) .
This provides both an ignore parser and a file - aware processor .
This provides both an ignore parser and a file - aware processor .
@ -23,19 +24,19 @@ format for .gitignore files (https://git-scm.com/docs/gitignore).
The formatting rules are as follows :
The formatting rules are as follows :
- Parsing is line - by - line
- Parsing is line - by - line
- Empty lines are ignored
- Empty lines are ignored
- Lines the begin with # ( comments ) will be ignored
- Lines the begin with # ( comments ) will be ignored
- Leading and trailing spaces are always ignored
- Leading and trailing spaces are always ignored
- Inline comments are NOT supported ( ' foo * # Any foo ' does not contain a comment )
- Inline comments are NOT supported ( ' foo * # Any foo ' does not contain a comment )
- There is no support for multi - line patterns
- There is no support for multi - line patterns
- Shell glob patterns are supported . See Go ' s "path/filepath" . Match
- Shell glob patterns are supported . See Go ' s "path/filepath" . Match
- If a pattern begins with a leading ! , the match will be negated .
- If a pattern begins with a leading ! , the match will be negated .
- If a pattern begins with a leading / , only paths relatively rooted will match .
- If a pattern begins with a leading / , only paths relatively rooted will match .
- If the pattern ends with a trailing / , only directories will match
- If the pattern ends with a trailing / , only directories will match
- If a pattern contains no slashes , file basenames are tested ( not paths )
- If a pattern contains no slashes , file basenames are tested ( not paths )
- The pattern sequence "**" , while legal in a glob , will cause an error here
- The pattern sequence "**" , while legal in a glob , will cause an error here
( to indicate incompatibility with . gitignore ) .
( to indicate incompatibility with . gitignore ) .
Example :
Example :
@ -58,10 +59,10 @@ Example:
a [ b - d ] . txt
a [ b - d ] . txt
Notable differences from . gitignore :
Notable differences from . gitignore :
- The ' * * ' syntax is not supported .
- The ' * * ' syntax is not supported .
- The globbing library is Go ' s ' filepath . Match ' , not fnmatch ( 3 )
- The globbing library is Go ' s ' filepath . Match ' , not fnmatch ( 3 )
- Trailing spaces are always ignored ( there is no supported escape sequence )
- Trailing spaces are always ignored ( there is no supported escape sequence )
- The evaluation of escape sequences has not been tested for compatibility
- The evaluation of escape sequences has not been tested for compatibility
- There is no support for ' \ ! ' as a special leading sequence .
- There is no support for ' \ ! ' as a special leading sequence .
* /
* /
package ignore // import "helm.sh/helm/v3/internal/ignore"
package ignore // import "helm.sh/helm/v3/internal/ignore"