Implement check-executables-have-shebangs as builtin-hook#924
Implement check-executables-have-shebangs as builtin-hook#924j178 merged 11 commits intoj178:masterfrom
check-executables-have-shebangs as builtin-hook#924Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #924 +/- ##
==========================================
+ Coverage 89.93% 90.07% +0.13%
==========================================
Files 66 67 +1
Lines 12223 12391 +168
==========================================
+ Hits 10993 11161 +168
Misses 1230 1230 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
24297d2 to
d1f5a01
Compare
|
I'm having some trouble setting It's almost certainly due to line 750 in #[cfg(not(unix))]
{
executable = {
let ext = path.extension().and_then(|ext| ext.to_str());
ext.is_some_and(|ext| ext == "exe" || ext == "bat" || ext == "cmd")
};
}edit: created this issue: #928 With the other bug mentioned above it could be too much for just 1 PR though. |
d1f5a01 to
a232e1f
Compare
|
Thank you! I'll take a look soon. |
check-executables-have-shebangs as builtin-hook
e22d418 to
214955d
Compare
|
I'll try to resolve #928, then we can get this merge. |
I mentioned it in the other PR. But the way pre-commit resolves this in windows is, send all files to the hook and resolve for those marked as executable in the hook itself. Hence it always returning passed in the output above. |
📦 Cargo Bloat ComparisonBinary size change: +0.62% (16.1 MiB → 16.2 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
e6454ad to
e7c2810
Compare
e7c2810 to
404e96f
Compare
404e96f to
b92d7b2
Compare
9eb62c1 to
3614c05
Compare
|
Thank you! |
Description
Following the information provided in 880. This is an implementation of the
check-executables-have-shebangshook.The check-executables-have-shebangs has 1k grep.app hits. It's the final unimplemented hook used by
airflowas mentioned in this comment.Notes
.shfiles aren't seen as executable and setting them as executable usinggit add --chmod=+x {file_name}. See [bug] Executables not correctly identified on windows #928git config core.fileMode(returns false only on win32`1. Add
win32to the ci/cd pipeline2. We need to be able to overwrite the output of this command in tests (like one would in python)
identify.rs. Where the first element of a shebangs was being accessed. However theparse_shebangfunction can still return anOkwith an empty vector, making the access fail.identify.rsbut theparse_shebangfunction still contains a Todo.Memory changes
+89,800 bytes (+1.06%) increase from master to feature branch
Performance
Ran these commands on the ardupilot repository:
simply because it was the top-hit on grap.app
Linux
Linux output:
