You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check for executable bits that disagree with shebangs
It is rare that text files should be stored in a repository with a
leading `#!` (shebang, a.k.a. hashbang) but `-x` permissions, or
with no leading `#!` but `+x` permissions. But it is easy for this
to happen by accident.
This introduces a script to check for that situation -- currently
only in files whose names end in `.sh`, which are the files in
which this minor problem has tended to arise in this repository.
This adds a `justfile` recipe for it, as well as a CI job that runs
the script. (The CI job does not run it via `just`, since not doing
so allows it to save time by not installing anything.)
Currently, this:
- Looks only at what is committed and staged, ignoring unstaged
files and unstaged mode changes. (This is intended to allow it to
be cross platform, because on Windows, Git repositories support
the same modes as anywhere else, but the filesystem doesn't
support Unix-style executable permissions.)
- Is implemented as a shell script. Unlike `copy-packetline.sh`,
there would be no major disadvantage to having this be Rust code
instead, since it is never used to correct a problem that keeps
Rust code from building.
- Is called from a separate CI job than any others. But it could
probably be called from one of the existing jobs instead.
There are some files already in the repository that fail the new
check, which should be given `+x` permissions. In this commit, they
are kept as-is, and new files that should be detected as *wrongly*
having `+x` permissions are added. This is to verify that the
script is fully working as expected, including when run on CI. Once
that is confirmed, the new test files can be removed, the scripts
missing `+x` fixed, and the CI job made to run only on Ubuntu.
(See the commented discussion in GitoxideLabs#1589 for further information.)
0 commit comments