eborden / filepattern Goto Github PK
View Code? Open in Web Editor NEWA file path matching library
License: BSD 3-Clause "New" or "Revised" License
A file path matching library
License: BSD 3-Clause "New" or "Revised" License
Currently when matching a FilePattern and FilePath, if there is a .
in the FilePattern, that can either match a literal .
in the FilePath, or be ignored. Conversely, every .
in a FilePath must be matched explicitly or with something like *
or **
. That behaviour is confusing and weird. I see two sensible possible routes forward:
.
paths in both FilePattern and FilePath..
has no special behaviour in either - it can be matched literally, but nothing else.The concern with option 2 is that when walking a directory structure, .
really does have no meaning, so it is a bit inconsistent. The concern with option 1 is that it's magic behaviour that isn't otherwise well founded. Thoughts? (CC @eborden and @snowleopard)
The Shake paths, as per ndmitchell/shake#376, don't match absolute paths - so **/*.c
will match test/foo.c
but not /test/foo.c
or C:/test/foo.c
. While it's somewhat useful, it's highly inconsistent in the code, and requires deciding whether C:foo.c
or /foo.c
are relative or absolute on Windows (in truth they are bit of both...). My inclination is that when moving to a filepattern
library that whole relative/absolute mess should be thrown out, and **/foo.c
should be equivalent to takeFileName x == "foo.c"
, regardless of absolute vs relative.
My thoughts are that if people want to avoid matching relative paths in their Shake build system they can do:
priority 100 $ isAbsolute ?> \_ -> return ()
Namely add a rule with top priority that always matches absolute paths and doesn't build them.
I did a dummy removal of the absolute/relative stuff and a lot of tests got simpler, in particular those about walker
and ?==
correspondence, which certainly suggests it is the right semantics.
Let's release filepattern
on hackage. What is left to do?
@ndmitchell In this comment you mentioned wanting to make other changes. Could you enumerate them here so that they can be tackled?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.