Skip to content
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

Loader: support dirs and subdirs in .autoload and support ^ in matches #716

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hhaensel
Copy link
Member

@hhaensel hhaensel commented Jun 4, 2024

Currently, .autoload only supports files in the root_dir.

This PR refactors sort_load_order() and autoload() to support

  • any file within the root_dir including subdirs (any pathseparator is allowed)
  • dirs and subdirs
  • ^ to mean the beginning of filenames relative to root_dir for matches (namematch, skipmatch)

proposed ToDos:

  • expand namematch and skipmatch to directories
  • find a notation to include/exclude regex file patterns, e.g.
    • --^skip/a.* for excluding files
    • ++^noskip/a.* for including files

@essenciary @PGimenez what do you think?

Alternatively we could implement Glob.jl-matching, which sounds tempting.

@essenciary
Copy link
Member

@hhaensel Great idea, thank you! I'm OK with Glob.jl, I see that it has no dependencies and is actively maintained.

@hhaensel
Copy link
Member Author

hhaensel commented Jun 5, 2024

There's an open issue in Glob.jl to add globstar support ("**/" syntax).
I just added a respective PR, let's hope that it passes all the edge cases. It would strongly simplify the docs, because people know that notation from .gitignore.

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