Skip to content

Conversation

@ashb
Copy link
Contributor

@ashb ashb commented Apr 25, 2025

There was a logic bug where index wasn't incremenetd, so we
would search through the file for the regex, but index was still 0
so the index always got put after line 0.

Without this fix, in the test PHP file we ended up with this:

<!-- Hi -->
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

<html>
<?php
print "Hello";

@ashb
Copy link
Contributor Author

ashb commented May 8, 2025

K, this has a glitch where if the regex is not found it inserts it before the last line.

@amoghrajesh
Copy link

@Lucas-C can we please get a review on this PR when you have some time?

@Lucas-C
Copy link
Owner

Lucas-C commented May 26, 2025

Thank you for this fix @ashb!

Could you please rebase this PR?
It is currently failing du to a Pylint check that I just disabled on the master branch (too-many-positional-arguments):
24c29be

There was a logic bug where `index` wasn't incremenetd, so we
would search through the file for the regex, but index was still 0
so the index always got put after line 0.
@ashb
Copy link
Contributor Author

ashb commented Jun 5, 2025

@Lucas-C Rebased!

@Lucas-C Lucas-C merged commit fd3fbe8 into Lucas-C:master Jun 5, 2025
8 checks passed
@Lucas-C
Copy link
Owner

Lucas-C commented Jun 5, 2025

Merged! Thank you @ashb 👍

@ashb ashb deleted the fix-insert-after-regex branch June 5, 2025 15:17
potiuk added a commit to potiuk/airflow that referenced this pull request Jul 6, 2025
We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.
potiuk added a commit to potiuk/airflow that referenced this pull request Jul 6, 2025
We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
potiuk added a commit to potiuk/airflow that referenced this pull request Jul 6, 2025
We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
potiuk added a commit to potiuk/airflow that referenced this pull request Jul 6, 2025
We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
potiuk added a commit to apache/airflow that referenced this pull request Jul 6, 2025
We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
potiuk added a commit to potiuk/airflow that referenced this pull request Jul 6, 2025
…he#52931)

We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.

(cherry picked from commit 535d71d)
potiuk added a commit to potiuk/airflow that referenced this pull request Jul 6, 2025
…mmit's (apache#52931)

We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
(cherry picked from commit 535d71d)

Co-authored-by: Jarek Potiuk <[email protected]>
potiuk added a commit to potiuk/airflow that referenced this pull request Jul 6, 2025
…mmit's (apache#52931)

We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
(cherry picked from commit 535d71d)

Co-authored-by: Jarek Potiuk <[email protected]>
potiuk added a commit to apache/airflow that referenced this pull request Jul 6, 2025
…mmit's (#52931) (#52942)

We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
(cherry picked from commit 535d71d)
kaxil pushed a commit to apache/airflow that referenced this pull request Jul 7, 2025
…mmit's (#52931) (#52942)

We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
(cherry picked from commit 535d71d)
kaxil pushed a commit to apache/airflow that referenced this pull request Jul 7, 2025
…mmit's (#52931) (#52942)

We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
(cherry picked from commit 535d71d)
kaxil pushed a commit to apache/airflow that referenced this pull request Jul 9, 2025
…mmit's (#52931) (#52942)

We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
(cherry picked from commit 535d71d)
HsiuChuanHsu pushed a commit to HsiuChuanHsu/airflow that referenced this pull request Jul 10, 2025
…he#52931)

We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
kaxil pushed a commit to apache/airflow that referenced this pull request Jul 11, 2025
…mmit's (#52931) (#52942)

We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
(cherry picked from commit 535d71d)
kaxil pushed a commit to apache/airflow that referenced this pull request Jul 11, 2025
…mmit's (#52931) (#52942)

We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
(cherry picked from commit 535d71d)
stephen-bracken pushed a commit to stephen-bracken/airflow that referenced this pull request Jul 15, 2025
…he#52931)

We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Sep 25, 2025
…mmit's (#52931) (#52942)

We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.
(cherry picked from commit 535d71d91f36d3d9859d32e4695f0e81a2696a4b)

GitOrigin-RevId: 51645de62637eee2b3130c3ba64323b05c4792e2
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Oct 23, 2025
We are still waiting for release of the Lucas's pre-commit after
the Lucas-C/pre-commit-hooks#103 has
been merged - and for now we need to use `bleeding-edge` for
the repo.

Also upgrades zizmor and solves using "env." in shell commands
that might lead to security issues.

GitOrigin-RevId: 535d71d91f36d3d9859d32e4695f0e81a2696a4b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants