Skip to content

[CI] Add pre-commit hook to auto insert license for RST files#2752

Draft
jbampton wants to merge 1 commit intoapache:masterfrom
jbampton:auto-insert-license-rst-files
Draft

[CI] Add pre-commit hook to auto insert license for RST files#2752
jbampton wants to merge 1 commit intoapache:masterfrom
jbampton:auto-insert-license-rst-files

Conversation

@jbampton
Copy link
Member

Apache Airflow uses this same "insert-license" hook for RST files

https://github.com/apache/airflow/blob/d1455c892fedf1256ed88e389bd0ededad8ad4a4/.pre-commit-config.yaml#L73

https://github.com/apache/airflow/blob/main/scripts/ci/license-templates/LICENSE.rst

We already use pre-commit to insert licenses for other files

Did you read the Contributor Guide?

Is this PR related to a ticket?

  • No:
    • this is a CI update. The PR name follows the format [CI] my subject

What changes were proposed in this PR?

Added another check / test to our pre-commit framework

How was this patch tested?

  • Ran: sedona$ pre-commit run --all-files to test the insert license hook both before and after the license headers were auto inserted
  • opened and viewed some of the RST files in my IDE PyCharm in both editor and preview mode after the license headers were inserted
  • Ran: sedona$ cd python/sedona/doc; make html and viewed the generated HTML files in _build folder in my IDE and no license headers were present. Also opened some of these HTML files in Firefox and they display correctly

Did this PR include necessary documentation updates?

  • No, this PR does not affect any public API so no need to change the documentation.

@jbampton jbampton requested a review from jiayuasu as a code owner March 13, 2026 20:09
@jbampton jbampton added pre-commit Pull requests that update pre_commit code docs labels Mar 13, 2026
@jiayuasu
Copy link
Member

@zhangfengcdt I think these RST files were automatically generated, right?

@jbampton jbampton marked this pull request as draft March 16, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs pre-commit Pull requests that update pre_commit code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants