Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Regex to remove comments clashing with file globbing - causing hanging process #110
I've run in to an issue when using Stylus file globbing for
Stylint process can hang indefinitely, using 100% CPU (depending on file length, and the location of the glob within the file).
It seems the regex in
The following gif shows a stripped back example - you can see the 'steps' in the top-right ~doubling with each new-line.
Live Example - https://regex101.com/r/jU0eJ2/1
New regex which accounts for this edge-case. I know @benedfit is taking a look at possible fix, but we're finding it hard to find a solution which doesn't introduce another edge-case where an actual comment gets missed, so I thought I'd raise here in the meantime.
Playing around with it in regexr/regex101, it doesn't seem to match the same way the old regex matched.
I ended up tweaking the existing one, which seems to solve the problem: see here
It's on develop now, if you want to pull and take a look. I'll push it up to npm with confirmation that it solves the issue.