-
Notifications
You must be signed in to change notification settings - Fork 237
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
Remove filetype checking #32
Conversation
@@ -77,4 +77,4 @@ Run Mentat from within your project directory. Mentat uses git, so if your proje | |||
|
|||
`mentat <paths to files or directories>` | |||
|
|||
If you provide a directory, Mentat will add all non-hidden text files in that directory to it's context. If this exceeds the GPT-4 token context limit, try running Mentat with just the files you need it to see. | |||
If you provide a directory, Mentat will add all non git-ignored text files in that directory to it's context. If you provide a glob pattern, Mentat will add all files matching the pattern to it's context. If this exceeds the GPT-4 token context limit, try running Mentat with just the files you need it to see. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you provide a directory, Mentat will add all non git-ignored text files in that directory to it's context. If you provide a glob pattern, Mentat will add all files matching the pattern to it's context. If this exceeds the GPT-4 token context limit, try running Mentat with just the files you need it to see. | |
List the files you would like Mentat to read and edit as arguments. Mentat will add each of them to context, so be careful not to exceed the GPT-4 token context limit. To add multiple files at once, you can also provide directories as arguments. When a directory is provided, Mentat will add all the contained files, except for ones ignored in your `.gitignore`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we not mentioning that you an use globs as file paths?
### File Exclude Glob list | ||
List of [glob patterns](https://docs.python.org/3/library/glob.html) that will exclude all files from context that it matches starting from the given directory. | ||
List of [glob patterns](https://docs.python.org/3/library/glob.html) that will exclude all files from context that it matches starting from the git root. Importantly, this means that the pattern to exclude all files ending with `.py` would be `**/*.py` rather than `*.py`. Here is an example that would exclude all hidden directories and files: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List of [glob patterns](https://docs.python.org/3/library/glob.html) that will exclude all files from context that it matches starting from the git root. Importantly, this means that the pattern to exclude all files ending with `.py` would be `**/*.py` rather than `*.py`. Here is an example that would exclude all hidden directories and files: | |
List of [glob patterns](https://docs.python.org/3/library/glob.html) to exclude files from being read/edited by Mentat. These take effect whenever you provide Mentat with a directory as an argument. Mentat will add all files in the directory that are not in your `.gitignore` and do not match these glob patterns. Glob patterns are interpreted from the git root location. If you wanted to exclude all files ending in `.py`, the pattern to use would be `**/*.py` rather than `*.py`. Here is an example that would exclude all hidden directories and files: |
# mimetypes is OS dependent, so it's best to add as many extensions as we can | ||
# fmt: off | ||
default_filetype_include_list = [ | ||
".py", # Python | ||
".java", # Java | ||
".scala", # Scala | ||
".kt", # Kotlin | ||
".php", # PHP | ||
".html", # HTML | ||
".css", # CSS | ||
".less", # Less | ||
".scss", # SCSS | ||
".js", # Javascript | ||
".ts", # Typescript | ||
".c", # C | ||
".cpp", # C++ | ||
".h", # C Header | ||
".cs", # C# | ||
".go", # Go | ||
".rs", # Rust | ||
".rb", # Ruby | ||
".swift", # Swift | ||
".lua", # Lua | ||
".pl", # Perl | ||
".sql", # SQL | ||
".r", # R | ||
".m", # objective-c | ||
".sh", # shell scripts | ||
".f", # fortran | ||
".jsx", # javascript react | ||
".tsx", # typescript react | ||
] | ||
default_filetype_exclude_list = [] | ||
# fmt: on | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
Massive. |
Remove filetype checking, add glob includes, and fix a few bugs. To test include globs in zsh, put quotes around paths.
In case you're wondering why the glob path expansion is at the very beginning (outside of codefilemanager), there are 2 reasons: