-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc.go
More file actions
25 lines (21 loc) · 1.01 KB
/
doc.go
File metadata and controls
25 lines (21 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// SPDX-License-Identifier: MIT
// Copyright (c) 2026 WoozyMasta
// Source: github.com/woozymasta/pathrules
/*
Package pathrules implements gitignore-like path matching with reusable include/exclude policies.
The package is intentionally generic and can be used for ignore workflows, allow-list workflows,
compression selection, conversion selection, and other path-based pipelines.
Basic flow:
- parse rules from text (`ParseRules`)
- optionally load rules from file (`LoadRulesFile`)
- optionally build extension-based include rules (`ParseExtensions`)
- compile matcher (`NewMatcher`)
- ask for decision (`Decide` / `Included` / `Excluded`)
For hierarchical rule files, use `Provider`:
- create provider with root directory and rules file name
- evaluate paths relative to that root
- provider caches compiled directory matchers
- for one-directory batches use `DecideInDir` / `IncludedInDir`
- optional symlink/junction escape hardening: `EnableSymlinkEscapeCheck` (disabled by default)
*/
package pathrules