Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run pre-commit

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
pre-commit:
name: Run pre-commit hooks
runs-on: ubuntu-latest
steps:
- name: 'Checkout ${{ github.ref }} ( ${{ github.sha }} )'
uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: '3.13'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pre-commit
- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v5
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: pre-commit run --color=always --all-files --show-diff-on-failure
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: meta
hooks:
- id: check-hooks-apply
name: check that hooks apply
description: check that all the hooks apply to the repository
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-illegal-windows-names
- id: check-json
- id: check-merge-conflict
- id: check-yaml
- id: detect-private-key
# - id: end-of-file-fixer
# - id: fix-byte-order-marker
- id: forbid-submodules
- id: mixed-line-ending
- id: trailing-whitespace
files: \.(cgi|rdf|rb)$
2 changes: 1 addition & 1 deletion www/members/nominate_board.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ _html do
_ %Q{
Use this form to nominate any Member for the ASF Board of Director election.
It automatically adds a properly formatted nomination to the #{ASF::MemberFiles::NOMINATED_BOARD} file,
and will then
and will then
}
_strong "send an email to the #{MAILING_LIST} list"
_ ' from you with the nomination, '
Expand Down
4 changes: 2 additions & 2 deletions www/members/nominate_member.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ _html do
_ %Q{
Use this form to nominate any Committer the new ASF Membership election.
It automatically adds a properly formatted nomination to the #{ASF::MemberFiles::NOMINATED_MEMBERS} file,
and will then
and will then
}
_strong "send an email to the #{MAILING_LIST} list"
_ ' from you with the nomination, '
_a 'as is tradition.', href: 'https://lists.apache.org/list?members@apache.org:2023-2:%22MEMBER%20NOMINATION%22'
_p
_p
_p do
_ 'This form only supports adding new nominations of existing committers; '
_ 'there is now a form to '
Expand Down
4 changes: 2 additions & 2 deletions www/members/update_board_nominations.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ user = ASF::Auth.decode(env = {})
source = ASF::MeetingUtil.get_latest_svnpath(ASF::MemberFiles::NOMINATED_BOARD)

def emit_form(url, revision, original, updated, diff, env)

_whimsy_panel(url, style: 'panel-success') do
_form.form_horizontal method: 'post' do
_input type: 'hidden', name: 'original', value: original
Expand All @@ -34,7 +34,7 @@ def emit_form(url, revision, original, updated, diff, env)
field = 'difference'
rows = nil
rows = 1 + diff.split("\n").size if diff.size > 0
_whimsy_forms_input(label: 'Difference', name: field, id: field, rows: rows, readonly: true,
_whimsy_forms_input(label: 'Difference', name: field, id: field, rows: rows, readonly: true,
value: diff.size > 0 ? diff : '[No differences found]'
)
end
Expand Down
4 changes: 2 additions & 2 deletions www/members/update_member_nominations.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ user = ASF::Auth.decode(env = {})
source = ASF::MeetingUtil.get_latest_svnpath(ASF::MemberFiles::NOMINATED_MEMBERS)

def emit_form(url, revision, original, updated, diff, env)

_whimsy_panel(url, style: 'panel-success') do
_form.form_horizontal method: 'post' do
_input type: 'hidden', name: 'original', value: original
Expand All @@ -34,7 +34,7 @@ def emit_form(url, revision, original, updated, diff, env)
field = 'difference'
rows = nil
rows = 1 + diff.split("\n").size if diff.size > 0
_whimsy_forms_input(label: 'Difference', name: field, id: field, rows: rows, readonly: true,
_whimsy_forms_input(label: 'Difference', name: field, id: field, rows: rows, readonly: true,
value: diff.size > 0 ? diff : '[No differences found]'
)
end
Expand Down
4 changes: 2 additions & 2 deletions www/officers/update_affiliations.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end
source = File.join(ASF::SVN.svnurl!('officers'),'affiliations.txt')

def emit_form(url, revision, original, updated, diff, env)

_whimsy_panel(url, style: 'panel-success') do
_form.form_horizontal method: 'post' do
_input type: 'hidden', name: 'original', value: original
Expand All @@ -37,7 +37,7 @@ def emit_form(url, revision, original, updated, diff, env)
field = 'difference'
rows = nil
rows = 1 + diff.split("\n").size if diff.size > 0
_whimsy_forms_input(label: 'Difference', name: field, id: field, rows: rows, readonly: true,
_whimsy_forms_input(label: 'Difference', name: field, id: field, rows: rows, readonly: true,
value: diff.size > 0 ? diff : '[No differences found]'
)
end
Expand Down
8 changes: 4 additions & 4 deletions www/roster/views/actions/memstat.json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@
The membership withdrawal request that was registered for you has now been actioned.
Your details have been removed from the membership roster.
You have also been unsubscribed from members-only private email lists.

Warm Regards,

Secretary, Apache Software Foundation
secretary@apache.org
EOD
Expand All @@ -161,9 +161,9 @@
body <<~EOD
This acknowledges receipt of your request to rescind your membership withdrawal request.
The request has been deleted, and your membership status will be unaffected.

Warm Regards,

Secretary, Apache Software Foundation
secretary@apache.org
EOD
Expand Down