Gitignore Checker¶
GitignoreChecker
¶
Checks for files and folders in a directory, excluding those ignored by .gitignore.
This class provides functionality to scan a directory and identify Python files and directories that are not excluded by the associated .gitignore file. It parses the .gitignore file, loads patterns, and then checks each file/folder against these patterns.
Source code in repo_agent/utils/gitignore_checker.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
__init__(directory, gitignore_path)
¶
Initializes a checker to identify files ignored by Git, given a directory and .gitignore file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
directory
|
str
|
The directory to scan for ignored files. |
required |
gitignore_path
|
str
|
The path to the .gitignore file. |
required |
Returns:
Type | Description |
---|---|
None |
Source code in repo_agent/utils/gitignore_checker.py
check_files_and_folders()
¶
Identifies and lists Python files and directories within a given directory, respecting configured ignore patterns.
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
A list of relative paths to non-ignored Python files and directories. |