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 — Attempt to add fixing of BOMs by jgowdy · Pull Request #522 · pre-commit/pre-commit-hooks

Conversation

@jgowdy

@jgowdy jgowdy commented Oct 5, 2020

Copy link
Copy Markdown
Contributor

I'm attempting to add automatic fixing of BOMs

Sorry, something went wrong.

Uh oh!

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

All reactions
@jgowdy
jgowdy marked this pull request as draft October 5, 2020 16:39
asottile
asottile reviewed Oct 5, 2020
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.

I think we should deprecate check-byte-order-marker, but we cannot remove it in this PR

Sorry, something went wrong.

Uh oh!

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

jgowdy reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread pre_commit_hooks/byte_order_marker.py Resolved

Uh oh!

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

Comment thread setup.cfg Resolved

Uh oh!

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

@jgowdy
jgowdy force-pushed the byte-order-marker-fix branch from 3de1539 to 5a7ca4e Compare October 5, 2020 16:53
@jgowdy
jgowdy marked this pull request as ready for review October 5, 2020 16:56
@jgowdy
jgowdy requested a review from asottile October 5, 2020 16:56
@jgowdy

jgowdy commented Oct 5, 2020

Copy link
Copy Markdown
Contributor Author

Sorry for the churn, I don't write much Python

All reactions

Sorry, something went wrong.

Uh oh!

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

@jgowdy
jgowdy marked this pull request as draft October 5, 2020 17:09
@jgowdy
jgowdy marked this pull request as ready for review October 5, 2020 17:10
@jgowdy
jgowdy force-pushed the byte-order-marker-fix branch 5 times, most recently from c8ef07f to f3cee4e Compare October 5, 2020 19:54
@jgowdy

jgowdy commented Oct 5, 2020

Copy link
Copy Markdown
Contributor Author

Okay, I think this is good now.

All reactions

Sorry, something went wrong.

Uh oh!

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

rohitjha
rohitjha approved these changes Oct 5, 2020
View reviewed changes
@jgowdy

jgowdy commented Oct 8, 2020

Copy link
Copy Markdown
Contributor Author

Would you mind adding a hacktoberfest-accepted label to this PR? I didn't make this change specifically for hacktoberfest, I need it, but I am participating in hacktoberfest. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

@asottile

asottile commented Oct 8, 2020

Copy link
Copy Markdown
Member

yeah sorry I've been slow about this -- I'll take a look when I get the chance 👍

All reactions

Sorry, something went wrong.

Uh oh!

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

@jgowdy @asottile
Add new byte-order-marker checker/fixer
d18bd5b
@asottile
asottile force-pushed the byte-order-marker-fix branch from f3cee4e to d18bd5b Compare October 11, 2020 18:31
asottile
asottile approved these changes Oct 11, 2020
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
Comment thread .pre-commit-hooks.yaml
- id: check-byte-order-marker
name: Check for byte-order marker
description: Forbid files which have a UTF-8 byte-order marker
name: 'check BOM - deprecated: use fix-byte-order-marker'

@asottile asottile Oct 11, 2020

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.

I shortened the name here so it doesn't wrap -- I should probably add a test for this

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread .pre-commit-hooks.yaml
entry: file-contents-sorter
language: python
files: '^$'
- id: fix-byte-order-marker

@asottile asottile Oct 11, 2020

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.

I renamed this to fix-byte-order-marker so it's more clear what it does

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pre_commit_hooks/fix_byte_order_marker.py

def main(argv: Optional[Sequence[str]] = None) -> int:
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to check')

@asottile asottile Oct 11, 2020

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.

I removed the --fix=no -- I'd rather have formatters-only

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pre_commit_hooks/fix_byte_order_marker.py

for filename in args.filenames:
with open(filename, 'rb') as f_b:
bts = f_b.read(3)

@asottile asottile Oct 11, 2020

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.

there was a leaking file descriptor here, I fixed that

Sorry, something went wrong.

Uh oh!

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

All reactions
@asottile asottile added the hacktoberfest-accepted label Oct 11, 2020
@asottile
asottile merged commit 08d1901 into pre-commit:master Oct 11, 2020
@Dunedan Dunedan mentioned this pull request Aug 31, 2021
check-byte-order-marker deprecation #645
Closed
apricote pushed a commit to hetznercloud/fleeting-plugin-hetzner that referenced this pull request Aug 11, 2025
Hetzner Cloud Bot @jooola
chore(deps): update pre-commit hook pre-commit/pre-commit-hooks to v6…
5567f57
… (hetznercloud/fleeting-plugin-hetzner!264)

This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pre-commit/pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks) | repository | major | `v5.0.0` -> `v6.0.0` |

Note: The `pre-commit` manager in Renovate is not supported by the `pre-commit` maintainers or community. Please do not report any problems there, instead [create a Discussion in the Renovate repository](https://github.com/renovatebot/renovate/discussions/new) if you have any questions.

---

### Release Notes

<details>
<summary>pre-commit/pre-commit-hooks (pre-commit/pre-commit-hooks)</summary>

### [`v6.0.0`](https://github.com/pre-commit/pre-commit-hooks/releases/tag/v6.0.0): pre-commit-hooks v6.0.0

[Compare Source](pre-commit/pre-commit-hooks@v5.0.0...v6.0.0)

#### Fixes

- `check-shebang-scripts-are-executable`: improve error message.
  - [#&#8203;1115](pre-commit/pre-commit-hooks#1115) MR by [@&#8203;homebysix](https://github.com/homebysix).

#### Migrating

- now requires python >= 3.9.
  - [#&#8203;1098](pre-commit/pre-commit-hooks#1098) MR by [@&#8203;asottile](https://github.com/asottile).
- `file-contents-sorter`: disallow `--unique` and `--ignore-case` at the same
  time.
  - [#&#8203;1095](pre-commit/pre-commit-hooks#1095) MR by [@&#8203;nemacysts](https://github.com/nemacysts).
  - [#&#8203;794](pre-commit/pre-commit-hooks#794) issue by [@&#8203;teksturi](https://github.com/teksturi).
- Removed `check-byte-order-marker` and `fix-encoding-pragma`.
  - `check-byte-order-marker`: migrate to `fix-byte-order-marker`.
  - `fix-encoding-pragma`: migrate to `pyupgrade`.
  - [#&#8203;1034](pre-commit/pre-commit-hooks#1034) MR by [@&#8203;mxr](https://github.com/mxr).
  - [#&#8203;1032](pre-commit/pre-commit-hooks#1032) issue by [@&#8203;mxr](https://github.com/mxr).
  - [#&#8203;522](pre-commit/pre-commit-hooks#522) MR by [@&#8203;jgowdy](https://github.com/jgowdy).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS42MS4xIiwidXBkYXRlZEluVmVyIjoiNDEuNjEuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
pat-s pushed a commit to devxygmbh/ansible-data-science-core that referenced this pull request Jan 22, 2026
devxy-bot Patrick Schratz
chore(deps): update pre-commit hook pre-commit/pre-commit-hooks to v6…
d41b62e
… (#72)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pre-commit/pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks) | repository | major | `v5.0.0` -> `v6.0.0` |

Note: The `pre-commit` manager in Renovate is not supported by the `pre-commit` maintainers or community. Please do not report any problems there, instead [create a Discussion in the Renovate repository](https://github.com/renovatebot/renovate/discussions/new) if you have any questions.

---

### Release Notes

<details>
<summary>pre-commit/pre-commit-hooks (pre-commit/pre-commit-hooks)</summary>

### [`v6.0.0`](https://github.com/pre-commit/pre-commit-hooks/releases/tag/v6.0.0): pre-commit-hooks v6.0.0

[Compare Source](pre-commit/pre-commit-hooks@v5.0.0...v6.0.0)

#### Fixes

- `check-shebang-scripts-are-executable`: improve error message.
  - [#&#8203;1115](pre-commit/pre-commit-hooks#1115) PR by [@&#8203;homebysix](https://github.com/homebysix).

#### Migrating

- now requires python >= 3.9.
  - [#&#8203;1098](pre-commit/pre-commit-hooks#1098) PR by [@&#8203;asottile](https://github.com/asottile).
- `file-contents-sorter`: disallow `--unique` and `--ignore-case` at the same
  time.
  - [#&#8203;1095](pre-commit/pre-commit-hooks#1095) PR by [@&#8203;nemacysts](https://github.com/nemacysts).
  - [#&#8203;794](pre-commit/pre-commit-hooks#794) issue by [@&#8203;teksturi](https://github.com/teksturi).
- Removed `check-byte-order-marker` and `fix-encoding-pragma`.
  - `check-byte-order-marker`: migrate to `fix-byte-order-marker`.
  - `fix-encoding-pragma`: migrate to `pyupgrade`.
  - [#&#8203;1034](pre-commit/pre-commit-hooks#1034) PR by [@&#8203;mxr](https://github.com/mxr).
  - [#&#8203;1032](pre-commit/pre-commit-hooks#1032) issue by [@&#8203;mxr](https://github.com/mxr).
  - [#&#8203;522](pre-commit/pre-commit-hooks#522) PR by [@&#8203;jgowdy](https://github.com/jgowdy).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS42MC4zIiwidXBkYXRlZEluVmVyIjoiNDEuNjAuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Reviewed-on: https://codefloe.com/devxy/ansible-data-science-core/pulls/72
Co-authored-by: devxy-bot <[email protected]>
Co-committed-by: devxy-bot <[email protected]>
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
+1 more reviewer
@rohitjha rohitjha rohitjha approved these changes
Reviewers whose approvals may not affect merge requirements

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.

3 participants

@jgowdy @asottile @rohitjha
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.