threeapples307 / closure-linter

Automatically exported from code.google.com/p/closure-linter
Apache License 2.0
0 stars 0 forks source link

Exlusion for fixjsstyle-script.py does not work correct on Windows OS #71

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. when using scripts\fixjsstyle-script.py script
2. I try to exclude some files and folders by using:
   -e editor -x jquery,.min.js,iscroll-lite.js

What is the expected output? What do you see instead?
I expect that these files would be excluded from fixing.
However the files are not 

What version of the product are you using? On what operating system?
2.3.5

Please provide any additional information below.

I fixed it by changing the line 155 in simplefileflags.py making it more 
exhaustive:
if f.endswith('/' + exclude) or f.endswith(exclude) or exclude in f or f == 
exclude:

The initial code based on ('/' + exclude) DOES NOT WORK ON WINDOWS as the 
Windows paths should be ('\\' + exclude).

(I'm not a Python developer, so I think the exclusion code can be simpler.)

My suggestion would be not only to exclude a specific resource but also to 
accept "*" exclusion patterns, not only the specified file. 

This would make it more flexible.

Original issue reported on code.google.com by spier...@gmail.com on 16 Jul 2013 at 8:44