Coder Social home page Coder Social logo

Comments (7)

sandyarmstrong avatar sandyarmstrong commented on April 18, 2024

Yeah, this is pretty annoying. I have the following little patch applied but it can cause some false positives when piping git status output, for example:

diff --git a/src/parse.py b/src/parse.py
index 8ee9175..1e2283e 100644
--- a/src/parse.py
+++ b/src/parse.py
@@ -22,10 +22,10 @@ import logger
 REPOS = ['www']

 MASTER_REGEX = re.compile(
-    '(\/?([a-z.A-Z0-9\-_]+\/)+[a-zA-Z0-9\-_.]+\.[a-zA-Z0-9]{1,10})[:-]{0,1}(\d+)?')
+    '(\/?([a-z.A-Z0-9\-_]+\/)+[a-zA-Z0-9\-_.]+)[:-]{0,1}(\d+)?')
 OTHER_BGS_RESULT_REGEX = re.compile(
     '(\/?([a-z.A-Z0-9\-_]+\/)+[a-zA-Z0-9_.]{3,})[:-]{0,1}(\d+)')
-JUST_FILE = re.compile('([a-zA-Z0-9\-_]+\.[a-zA-Z]{1,10})\s+')
+JUST_FILE = re.compile('([a-zA-Z0-9\-_.]+)\s+')
 FILE_NO_PERIODS = re.compile(
     '([a-zA-Z0-9\-_\/]{1,}\/[a-zA-Z0-9\-_]{1,})(\s|$|:)+')

Between this bug and #18, the released fpp is unusable on most of my repositories. But that diff makes it work well enough.

from pathpicker.

mrjbq7 avatar mrjbq7 commented on April 18, 2024

Why not just use something like os.path.isfile(pathname) to detect files?

from pathpicker.

sandyarmstrong avatar sandyarmstrong commented on April 18, 2024

@mrjbq7 on Hacker News, the devs said it's because users at Facebook keep their code mounted on network drives, and that would be slow. But they are open to adding it as an option.

from pathpicker.

mrjbq7 avatar mrjbq7 commented on April 18, 2024

That makes sense - however, half of my files seem not to have extensions and so this doesn't work very well. I also, don't see the need to differentiate between files and directories, since opening directories could be a valid use-case, too.

from pathpicker.

pedropedruzzi avatar pedropedruzzi commented on April 18, 2024

After #50, this issue is actualy about dot files and with no period in the CWD.
It seems that those are not detected by design since it's more likely that they are not paths in the input. For the CWD I don't believe checking path existence would be a problem with network drive. Let's patch that.

from pathpicker.

joni2back avatar joni2back commented on April 18, 2024

It makes sense, could be very hard to parse filenames without dots, taking into account that could be combined with another texts 😞
So, as @mrjbq7 says, os.path.isfile could be the best option although would be slow

from pathpicker.

pcottle avatar pcottle commented on April 18, 2024

Yeah lets move this into #83. We can likely put the filesystem logic as an experimental flag which should mitigate any performance issues we might encounter. I do think it's the right future of the project though, since then we can match on all sorts of things and eliminate a ton of false positives

from pathpicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.