-
Notifications
You must be signed in to change notification settings - Fork 410
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
Implemented per-directory metadata support #190
Conversation
|
||
-------------------------------------------------------------------------------- | ||
-- | Load directory-wise metadata | ||
loadGlobalMetadata :: Provider -> FilePath -> IO (M.Map String String) |
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.
Maybe use Metadata
instead of M.Map String String
here?
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.
fixed
Thanks, the code looks good! However, one issue is that it doesn't seem to take invalidating into account: e.g., when we change a metadata field in
We should rebuild Additionally, we also want to add a test case in |
I will try to add new step to |
I had to prepend some Rules to global Rules set. This might be possible to replaced by a correct Store.set call. I also had to prepend some Compile rules.
It looks like it is much harder to implement invalidation. Universe doesn't normally include metadata files as they are not compiled, so I had to add a new rule. |
Should I add anything else in this pull request? |
Sorry for the late reply, I haven't had time to review this yet. I'll do it tomorrow evening. |
Any updates on this issue? |
@@ -53,7 +54,7 @@ run config verbosity rules = do | |||
provider <- newProvider store (shouldIgnoreFile config) $ | |||
providerDirectory config | |||
Logger.message logger "Running rules..." | |||
ruleSet <- runRules rules provider | |||
ruleSet <- runRules (internalRules >> rules) provider |
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.
We probably want to have internalRules
last. Earlier rules override later rules, and we want to give the user the option of overwriting them.
Looks good to merge! The only thing that might be a bit nicer is if we could now use the internal rules to also do the dependency tracking for the |
Didn't clean up unused code though
I have extended global metadata code to handle |
The feature is really coming together, thanks for all the hard work, I really appreciate it! :-) I might clean it up a bit before releasing it but I'm merging it in now. |
Implemented per-directory metadata support
One more question. In |
If 2014-02-03 Jasper Van der Jeugt notifications@github.com:
|
Oh, I get it, it's the |
Why was this reverted? |
Implemented per-directory metadata file as it was mentioned in #152.
Format is closed to the one described in the issue, but after
---
I have a glob pattern terminated by newline (space at the end are considered a part of the pattern). The path in this pattern is relative to the directory with the metadata file.Metadata in old locations (embedded and *.metadata) override per-directory metadata and the one in a subdirectory overrides the one in a parent directory.