Skip to content

Commit fdfa9a4

Browse files
h-vetinarijaimergp
andauthored
sort src/core.csv by github handle (#2493)
* sort src/core.csv by github handle * add pre-commit hook --------- Co-authored-by: jaimergp <[email protected]>
1 parent 7123830 commit fdfa9a4

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,13 @@ repos:
1818
rev: v0.11.2
1919
hooks:
2020
- id: ruff-format
21+
- repo: local
22+
hooks:
23+
- id: sort-csv
24+
name: Sort core and emeritus lists
25+
entry: scripts/sort_csv.py
26+
language: python
27+
types: [text]
28+
files: src/(core|emeritus)\.csv
2129
ci:
2230
autofix_prs: false

scripts/sort_csv.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python
2+
3+
import sys
4+
5+
for path in sys.argv[1:]:
6+
with open(path) as f:
7+
header = next(f)
8+
rows = sorted(f, key=str.lower)
9+
with open(path, "w") as f:
10+
f.write("".join([header, *rows]))

src/core.csv

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ cj-wright,[email protected],Christopher J. 'CJ' Wright
66
dopplershift,[email protected],Ryan May
77
ericdill,[email protected],Eric Dill
88
h-vetinari,[email protected],Axel Obermeier
9+
hmaarrfk,[email protected],Mark Harfouche
910
isuruf,[email protected],Isuru Fernando
11+
jaimergp,[email protected],Jaime Rodríguez-Guerra
1012
jakirkham,[email protected],John Kirkham
1113
jezdez,[email protected],Jannis Leidel
14+
kkraus14,[email protected],Keith Kraus
1215
loriab,[email protected],Lori A. Burns
1316
marcelotrevisani,[email protected],Marcelo Duarte Trevisani
1417
mariusvniekerk,[email protected],Marius van Niekerk
1518
mbargull,[email protected],Marcel Bargull
1619
minrk,[email protected],Min Ragan-Kelley
1720
mwcraig,[email protected],Matt Craig
1821
ocefpaf,[email protected],Filipe Pires Alvarenga Fernandes
22+
soapy1,[email protected],Sophia Castellarin
23+
sodre,[email protected],Patrick Sodré
1924
SylvainCorlay,[email protected],Sylvain Corlay
2025
synapticarbors,[email protected],Joshua Adelman
21-
sodre,[email protected],Patrick Sodré
22-
soapy1,[email protected],Sophia Castellarin
2326
viniciusdc,[email protected],Vinicius Douglas Cerutti
2427
wolfv,[email protected],Wolf Vollprecht
2528
xhochy,[email protected],Uwe L. Korn
26-
kkraus14,[email protected],Keith Kraus
27-
jaimergp,[email protected],Jaime Rodríguez-Guerra
28-
hmaarrfk,[email protected],Mark Harfouche

0 commit comments

Comments
 (0)