Skip to content

Conversation

aaronmarkham
Copy link

Description of changes:

  • Treat dotfiles as text files instead of unknown file types
  • Allow common config files (.bashrc, .vimrc, .raprc, etc.) through hidden file filters
  • Add test cases for dotfile patterns (.bashrc, .vimrc, .raprc, .testrc, etc.)

Previously, dotfiles were classified as FileType::Unknown and skipped during directory processing, preventing configuration files from being indexed.

This change enables indexing of:

  • Files ending in 'rc' (.bashrc, .vimrc, .raprc)
  • Files ending in 'config' (.gitconfig, .npmconfig)
  • Common dotfiles (.gitignore, .env, .dockerignore)

Fixes issue where configuration files showed 0 items after indexing.

Tested with .raprc and .testrc files - both now properly index content.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

- Treat dotfiles as text files instead of unknown file types
- Allow common config files (.bashrc, .vimrc, .raprc, etc.) through hidden file filters
- Add test cases for dotfile patterns (.bashrc, .vimrc, .raprc, .testrc, etc.)

Previously, dotfiles were classified as FileType::Unknown and skipped during
directory processing, preventing configuration files from being indexed.

This change enables indexing of:
- Files ending in 'rc' (.bashrc, .vimrc, .raprc)
- Files ending in 'config' (.gitconfig, .npmconfig)
- Common dotfiles (.gitignore, .env, .dockerignore)

Fixes issue where configuration files showed 0 items after indexing.

Tested with .raprc and .testrc files - both now properly index content.
// Allow common configuration files
filename.ends_with("rc")
|| filename.ends_with("config")
|| matches!(filename, ".gitignore" | ".env" | ".dockerignore")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this a CONSTANT so we we can use this collection in both places.

if let Some(filename) = path.file_name().and_then(|n| n.to_str()) {
if filename.starts_with('.') {
// Allow common configuration files
let is_config_file = filename.ends_with("rc")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constant or utility for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants