alexcouper / captainhook

Git hook scripts
BSD 3-Clause "New" or "Revised" License
54 stars 14 forks source link

`file` will incorrectly determine things to be Python #38

Closed OddBloke closed 10 years ago

OddBloke commented 10 years ago

NO CAPTAINHOOK MY BEHAVE SCENARIOS DONT COMPILE IN PYTHON 3 IM SORRY OK

We should probably shift to only using file if there is no extension.

alexcouper commented 10 years ago

Possibly related:

From @koddsson via twitter: https://gist.github.com/koddsson/5ce37d6c47e2ae2611dc

alexcouper commented 10 years ago

I believe both of you are running Ubuntu, right?

koddsson commented 10 years ago

Yep. Ubuntu 14.04 here.

λ bubblegum captainhook → λ git master → file README.md 
README.md: Python script, ASCII text executable
alexcouper commented 10 years ago

We may need to go down a different route with this and say a python file is one that ends in .py or has python in the first line of the file?

alexcouper commented 10 years ago

If it makes you feel any better, @Koddsson, file on my Mac tells me that all my .py files are Java.

koddsson commented 10 years ago

Hahah just a tad. Is there a reason why we are using the file utility rather than just going by extension?

Maybe we can do something like:

alexcouper commented 10 years ago

@koddsson The reason for this check is that the captainhook script itself had pep8 errors which was kind of ironic.

Yes, the flow you describe makes sense

alexcouper commented 10 years ago

Fixed.

koddsson commented 10 years ago

https://gist.github.com/koddsson/0a0a971a38a013a3df0f