GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add check for executability of scripts with shebangs by scop · Pull Request #545 · pre-commit/pre-commit-hooks

Conversation

@scop

@scop scop commented Jan 8, 2021

Copy link
Copy Markdown
Contributor

First cut, applies on top of #544.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@asottile

asottile commented Feb 4, 2021

Copy link
Copy Markdown
Member

@scop are you planning to finish this up?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@scop

scop commented Feb 5, 2021

Copy link
Copy Markdown
Contributor Author

Ah yeah, had forgotten about it. The problem is kind of with the "improved" git ls-files parser I added here. ls-files --stage is documented to output [<tag> ]<mode> <object> <stage> <file> but I haven't been able to construct a state in which it would ever actually output anything in the tag (even if the head version is tagged), hence no possibility to add a test case to complete the coverage.

If you know how to provoke it to output the tag, pointers appreciated.

The other option would be to revert back towards the current ls-files parser which doesn't have this "problem", but then again I don't see how it could work properly in case where it was actually fed the above formatted ls-files output with a tag in it, as it picks the first space separated token from it which in those cases would be the tag, not a "tag+mode" string as the implementation/naming implies.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@scop

scop commented Apr 13, 2021

Copy link
Copy Markdown
Contributor Author

@asottile any thoughts about the above?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asottile

asottile commented Apr 13, 2021

Copy link
Copy Markdown
Member

if the tag output is impossible then probably we don't need the code that would handle it

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@scop

scop commented May 4, 2021

Copy link
Copy Markdown
Contributor Author

Ok, this should be good now. I was confused about the tags thing -- it's not a "git tag" in the usual sense, but just file status identifiers that will appear only if ls-files is called with -t (which we don't): http://git-scm.com/docs/git-ls-files#Documentation/git-ls-files.txt--t

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

scop added 2 commits May 4, 2021 18:45
@scop @asottile
Refactor check_executables_have_shebangs for git ls-files reuse
9e7cd9f
@scop @asottile
Add check for executability of scripts with shebangs
391ae30
Closes #543
asottile
asottile approved these changes May 5, 2021
View reviewed changes

@asottile asottile left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@asottile
asottile merged commit 11cdc8d into pre-commit:master May 5, 2021
@scop
scop deleted the check-shebangs-executable branch May 5, 2021 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@asottile asottile asottile approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@scop @asottile
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.