Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
671e402
Update ruff, Biome and djhtml to their latest versions
FennemAI Oct 25, 2026
342f16a
Remove `# -*- coding: utf-8 -*-` declarations
FennemAI Oct 25, 2026
2cce9ed
Remove `from __future__` imports
FennemAI Oct 25, 2026
a2b81ff
Stop explicitly inheriting from `object`
FennemAI Oct 25, 2026
0dd2ea2
Use `super()` without arguments
FennemAI Oct 25, 2026
a4e94d3
Use `datetime.UTC` instead of `timezone.utc`
FennemAI Oct 25, 2026
f37b446
Remove extraneous parentheses
FennemAI Oct 25, 2026
032b49d
Use attribute access instead of `getattr` with a constant
FennemAI Oct 25, 2026
1497150
Use `from x import y` instead of `import x.y as y`
FennemAI Oct 25, 2026
3b3ef69
Use f-strings instead of `str.format()`
FennemAI Oct 25, 2026
6048762
Use f-strings instead of `%` formatting
FennemAI Oct 25, 2026
9156e74
Remove explicit positional indices from format strings
FennemAI Oct 25, 2026
4cf65cf
Use set comprehensions instead of `set([...])`
FennemAI Oct 25, 2026
1b7802a
Use dict comprehensions instead of `dict([...])`
FennemAI Oct 25, 2026
bb0ba44
Use set literals instead of `set([...])`
FennemAI Oct 25, 2026
f97b741
Use a literal instead of `dict()`
FennemAI Oct 25, 2026
25f68e9
Use `next(...)` instead of `[...][0]`
FennemAI Oct 25, 2026
e316240
Prefix unused unpacked variables with an underscore
FennemAI Oct 25, 2026
0a82272
Return boolean conditions directly
FennemAI Oct 25, 2026
a4b4919
Avoid a mutable default argument
FennemAI Oct 25, 2026
2da1f1d
Annotate mutable class attributes with `ClassVar`
FennemAI Oct 25, 2026
304bde4
Use a module logger instead of the root logger in cron scripts
FennemAI Oct 25, 2026
3754494
Only catch the expected errors from the archives API
FennemAI Oct 25, 2026
6c045c0
Remove unreachable "next" check from the close view
FennemAI Oct 25, 2026
2bd7863
Pass `check` explicitly to `subprocess.run` in run_dev.py
FennemAI Oct 25, 2026
3af7389
Remove unused `noqa` comments
FennemAI Oct 25, 2026
6787a75
Ignore the setuptools build directory
FennemAI Oct 25, 2026
717e221
Fix Biome noUnusedVariables warnings
FennemAI Oct 25, 2026
400a222
Fix Biome noUnusedFunctionParameters warnings
FennemAI Oct 25, 2026
a990103
Pass a radix to `parseInt`
FennemAI Oct 25, 2026
dfe530a
Fix Biome noImportantStyles warnings
FennemAI Oct 25, 2026
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ jobs:
- name: Run ruff check
uses: astral-sh/ruff-action@v2
with:
version: 0.15.20
version: 0.17.2

- name: Run ruff format --check
uses: astral-sh/ruff-action@v2
with:
version: 0.15.20
version: 0.17.2
args: "format --check"

- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: 1.9.4
version: 2.6.3

- name: Run Biome
run: biome ci .

- name: Install djhtml
run: pip install djhtml
run: pip install djhtml==3.0.11

- name: Run djhtml
run: djhtml pgcommitfest/*/templates/*.html pgcommitfest/*/templates/*.inc --tabwidth=1 --check
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/.idea/
/venv/
*.egg-info
/build/
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
format:
ruff format
npx @biomejs/biome@1.9.4 format --write
npx @biomejs/biome@2.6.3 format --write
djhtml pgcommitfest/*/templates/*.html pgcommitfest/*/templates/*.inc --tabwidth=1

lint:
ruff check
npx @biomejs/biome@1.9.4 check
npx @biomejs/biome@2.6.3 check

lint-fix:
ruff check --fix
npx @biomejs/biome@1.9.4 check --fix
npx @biomejs/biome@2.6.3 check --fix

lint-fix-unsafe:
ruff check --fix --unsafe-fixes
npx @biomejs/biome@1.9.4 check --fix --unsafe
npx @biomejs/biome@2.6.3 check --fix --unsafe

fix: format lint-fix-unsafe
19 changes: 8 additions & 11 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"$schema": "https://biomejs.dev/schemas/2.6.3/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": true,
"ignore": [],
"include": [
"media/commitfest/js/commitfest.js",
"media/commitfest/js/change_tag.js",
"media/commitfest/css/commitfest.css",
"biome.json"
"includes": [
"**/media/commitfest/js/commitfest.js",
"**/media/commitfest/js/change_tag.js",
"**/media/commitfest/css/commitfest.css",
"**/biome.json"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4
},
"organizeImports": {
"enabled": true
},
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"linter": {
"enabled": true,
"rules": {
"recommended": true
"preset": "recommended"
}
},
"javascript": {
Expand Down
27 changes: 17 additions & 10 deletions media/commitfest/css/commitfest.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

body {
--bs-body-font-size: 14px;
--bs-body-font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
"Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji",
--bs-body-font-family:
-apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans",
"Liberation Sans", Arial, sans-serif, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-sans-serif: -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
"Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji",
--bs-font-sans-serif:
-apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans",
"Liberation Sans", Arial, sans-serif, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

Expand Down Expand Up @@ -127,19 +129,19 @@ nav[aria-label="breadcrumb"] .float-end {

/* Remove underlines from tag links */
a:has(.badge) {
text-decoration: none !important;
text-decoration: none;
}

a:has(.badge):hover {
text-decoration: none !important;
text-decoration: none;
}

a .badge {
text-decoration: none !important;
text-decoration: none;
}

a:hover .badge {
text-decoration: none !important;
text-decoration: none;
}

/* Simple close button without float */
Expand Down Expand Up @@ -183,13 +185,18 @@ a:hover .badge {
}

/* Mobile: stack actions vertically, tablet+: horizontal */
/* The !important is needed to override Bootstrap's gap-2 and
* align-items-center utility classes, which use !important themselves. */
.navbar-actions {
flex-direction: column;
/* biome-ignore lint/complexity/noImportantStyles: see above */
gap: 0.5rem !important;
/* biome-ignore lint/complexity/noImportantStyles: see above */
align-items: stretch !important;
}

.navbar-actions .input-group {
/* biome-ignore lint/complexity/noImportantStyles: overrides the inline width in base.html */
width: 100% !important;
}

Expand Down Expand Up @@ -252,7 +259,7 @@ a:hover .badge {
to bottom,
rgba(248, 249, 250, 0) 0%,
rgba(248, 249, 250, 1) 50%
) !important;
border-top: none !important;
);
border-top: none;
pointer-events: none;
}
51 changes: 30 additions & 21 deletions media/commitfest/js/commitfest.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
// biome-ignore lint/correctness/noUnusedVariables: called from templates
function verify_reject() {
return confirm(
'Are you sure you want to close this patch as Rejected?\n\nThis should only be done when a patch will never be applied - if more work is needed, it should instead be set to "Returned with Feedback" or "Moved to next CF".\n\nSo - are you sure?',
);
}
// biome-ignore lint/correctness/noUnusedVariables: called from templates
function verify_withdrawn() {
return confirm(
"Are you sure you want to close this patch as Withdrawn?\n\nThis should only be done when the author voluntarily withdraws the patch.\n\nSo - are you sure?",
);
}
// biome-ignore lint/correctness/noUnusedVariables: called from templates
function verify_returned() {
return confirm(
'Are you sure you want to close this patch as Returned with Feedback?\n\nThis should be done if the patch is expected to be finished at some future time, but not necessarily in the next commitfest. If work is undergoing and expected in the next commitfest, it should instead be set to "Moved to next CF".\n\nSo - are you sure?',
);
}
function verify_next() {
return confirm(
'Are you sure you want to move this patch to the next commitfest?\n\nThis means the patch will be marked as closed in this commitfest, but will automatically be moved to the next one. If no further work is expected on this patch, it should be closed with "Rejected" or "Returned with Feedback" instead.\n\nSo - are you sure?',
);
}
function findLatestThreads() {
$("#attachThreadListWrap").addClass("loading");
$("#attachThreadSearchButton").addClass("disabled");
Expand All @@ -28,7 +26,7 @@ function findLatestThreads() {
.success((data) => {
sel = $("#attachThreadList");
sel.find("option").remove();
$.each(data, (m, i) => {
$.each(data, (_m, i) => {
sel.append(
$("<option/>")
.text(`${i.from}: ${i.subj} (${i.date})`)
Expand All @@ -49,7 +47,7 @@ function browseThreads(attachfunc, closefunc) {
$("#attachThreadList").find("option").remove();
$("#attachThreadMessageId").val("");
$("#attachModal").off("hidden.bs.modal");
$("#attachModal").on("hidden.bs.modal", (e) => {
$("#attachModal").on("hidden.bs.modal", () => {
if (closefunc) closefunc();
});
const attachModal = new bootstrap.Modal(
Expand Down Expand Up @@ -88,6 +86,7 @@ function browseThreads(attachfunc, closefunc) {
});
}

// biome-ignore lint/correctness/noUnusedVariables: called from templates
function attachThread(cfid, patchid, closefunc) {
browseThreads(
(msgid) => {
Expand All @@ -103,6 +102,7 @@ function attachThread(cfid, patchid, closefunc) {
);
}

// biome-ignore lint/correctness/noUnusedVariables: called from templates
function detachThread(cfid, patchid, msgid) {
if (
confirm(
Expand All @@ -114,10 +114,10 @@ function detachThread(cfid, patchid, msgid) {
p: patchid,
msg: msgid,
})
.success((data) => {
.success(() => {
location.reload();
})
.fail((data) => {
.fail(() => {
alert("Failed to detach thread!");
});
}
Expand Down Expand Up @@ -166,7 +166,7 @@ function updateAnnotationMessages(threadid) {
sel = $("#annotateMessageList");
sel.find("option").remove();
sel.append('<option value="">---</option>');
$.each(data, (i, m) => {
$.each(data, (_i, m) => {
sel.append(
`<option value="${m.msgid}">${m.from}: ${m.subj} (${m.date})</option>`,
);
Expand All @@ -176,6 +176,7 @@ function updateAnnotationMessages(threadid) {
$("#annotateMessageBody").removeClass("loading");
});
}
// biome-ignore lint/correctness/noUnusedVariables: called from templates
function addAnnotation(threadid) {
$("#annotateThreadList").find("option").remove();
$("#annotateMessage").val("");
Expand Down Expand Up @@ -209,13 +210,14 @@ function addAnnotation(threadid) {
location.reload();
}
})
.fail((data) => {
.fail(() => {
alert("Failed to annotate message");
$("#annotateMessageBody").removeClass("loading");
});
});
}

// biome-ignore lint/correctness/noUnusedVariables: called from templates
function annotateMsgPicked() {
const val = $("#annotateMessageList").val();
if (val) {
Expand All @@ -233,20 +235,22 @@ function annotateChanged() {
}
}

// biome-ignore lint/correctness/noUnusedVariables: called from templates
function deleteAnnotation(annid) {
if (confirm("Are you sure you want to delete this annotation?")) {
$.post("/ajax/deleteAnnotation/", {
id: annid,
})
.success((data) => {
.success(() => {
location.reload();
})
.fail((data) => {
.fail(() => {
alert("Failed to delete annotation!");
});
}
}

// biome-ignore lint/correctness/noUnusedVariables: called from templates
function flagCommitted(committer) {
const modal = new bootstrap.Modal(document.getElementById("commitModal"));
modal.show();
Expand All @@ -267,8 +271,9 @@ function flagCommitted(committer) {
return false;
}

// biome-ignore lint/correctness/noUnusedVariables: called from templates
function sortpatches(sortby) {
const sortkey = Number.parseInt($("#id_sortkey").val());
const sortkey = Number.parseInt($("#id_sortkey").val(), 10);
if (sortkey === sortby) {
$("#id_sortkey").val(-sortby);
} else if (-sortkey === sortby) {
Expand All @@ -285,11 +290,12 @@ function toggleButtonCollapse(buttonId, collapseId) {
const button = document.getElementById(buttonId);
const collapse = document.getElementById(collapseId);
button.classList.toggle("active");
const bsCollapse = new bootstrap.Collapse(collapse, {
new bootstrap.Collapse(collapse, {
toggle: true,
});
}

// biome-ignore lint/correctness/noUnusedVariables: called from templates
function togglePatchFilterButton(buttonId, collapseId) {
const collapse = document.getElementById(collapseId);

Expand All @@ -308,6 +314,7 @@ function togglePatchFilterButton(buttonId, collapseId) {
/*
* Upstream user search dialog
*/
// biome-ignore lint/correctness/noUnusedVariables: called from templates
function search_and_store_user() {
const modal = new bootstrap.Modal(
document.getElementById("searchUserModal"),
Expand All @@ -330,7 +337,7 @@ function search_and_store_user() {
alert(`Failed to import user: ${data}`);
}
})
.fail((data, statustxt) => {
.fail((_data, statustxt) => {
alert(`Failed to import user: ${statustxt}`);
});

Expand All @@ -340,6 +347,7 @@ function search_and_store_user() {
modal.show();
}

// biome-ignore lint/correctness/noUnusedVariables: called from templates
function findUsers() {
if (!$("#searchUserSearchField").val()) {
alert("No search term specified");
Expand All @@ -353,7 +361,7 @@ function findUsers() {
.success((data) => {
sel = $("#searchUserList");
sel.find("option").remove();
$.each(data, (i, u) => {
$.each(data, (_i, u) => {
sel.append(
`<option value="${u.u}">${u.u} (${u.f} ${u.l})</option>`,
);
Expand All @@ -375,6 +383,7 @@ function searchUserListChanged() {
}
}

// biome-ignore lint/correctness/noUnusedVariables: called from templates
function addGitCheckoutToClipboard(patchId) {
navigator.clipboard.writeText(`git remote add commitfest https://github.com/postgresql-cfbot/postgresql.git
git fetch commitfest cf/${patchId}
Expand All @@ -388,11 +397,11 @@ $(document).ready(() => {
const tooltipTriggerList = [].slice.call(
document.querySelectorAll('[data-bs-toggle="tooltip"]'),
);
const tooltipList = tooltipTriggerList.map(
(tooltipTriggerEl) => new bootstrap.Tooltip(tooltipTriggerEl),
);
for (const tooltipTriggerEl of tooltipTriggerList) {
new bootstrap.Tooltip(tooltipTriggerEl);
}

$("button.attachThreadButton").each((i, o) => {
$("button.attachThreadButton").each((_i, o) => {
const b = $(o);
b.click(() => {
$("#attachThreadAttachOnly").val("1");
Expand Down
Loading
Loading