chore: enable Clippy pedantic lints
Some checks failed
actionlint check / actionlint check (pull_request) Successful in 7s
conventional pull request title check / conventional pull request title check (pull_request) Successful in 3s
conventional commit messages check / conventional commit messages check (pull_request) Successful in 6s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 7s
GitLeaks check / GitLeaks check (pull_request) Successful in 14s
hadolint check / hadolint check (pull_request) Successful in 37s
htmlhint check / htmlhint check (pull_request) Successful in 36s
checkov check / checkov check (pull_request) Successful in 1m24s
Prettier check / Prettier check (pull_request) Successful in 37s
markdownlint check / markdownlint check (pull_request) Successful in 1m2s
ShellCheck check / ShellCheck check (pull_request) Successful in 30s
Stylelint check / Stylelint check (pull_request) Successful in 32s
yamllint check / yamllint check (pull_request) Successful in 32s
Rust check / Rust check (pull_request) Failing after 10m21s

This commit is contained in:
2026-02-09 18:29:01 +01:00
parent d208a81442
commit 80cf605960
10 changed files with 25 additions and 22 deletions

View File

@@ -12,7 +12,7 @@ pub(crate) fn ButtonPrimary(
button { button {
class: format!( class: format!(
"cursor-pointer pb-[6px] hover:pb-[7px] active:pb-[2px] mt-[1px] hover:mt-0 active:mt-[5px] hover:*:drop-shadow-[0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted)] active:*:drop-shadow-[0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted)] transition-all duration-150 {}", "cursor-pointer pb-[6px] hover:pb-[7px] active:pb-[2px] mt-[1px] hover:mt-0 active:mt-[5px] hover:*:drop-shadow-[0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted)] active:*:drop-shadow-[0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted)] transition-all duration-150 {}",
class.unwrap_or("".to_owned()) class.unwrap_or(String::new())
), ),
onclick: move |event| { onclick: move |event| {
if let Some(onclick) = onclick { if let Some(onclick) = onclick {

View File

@@ -12,7 +12,7 @@ pub(crate) fn ButtonSecondary(
button { button {
class: format!( class: format!(
"cursor-pointer pb-[6px] hover:pb-[7px] active:pb-[2px] mt-[1px] hover:mt-0 active:mt-[5px] hover:*:drop-shadow-[0_7px_0_var(--color-gray-800)] active:*:drop-shadow-[0_2px_0_var(--color-gray-800)] transition-all duration-150 {}", "cursor-pointer pb-[6px] hover:pb-[7px] active:pb-[2px] mt-[1px] hover:mt-0 active:mt-[5px] hover:*:drop-shadow-[0_7px_0_var(--color-gray-800)] active:*:drop-shadow-[0_2px_0_var(--color-gray-800)] transition-all duration-150 {}",
class.unwrap_or("".to_owned()) class.unwrap_or(String::new())
), ),
onclick: move |event| { onclick: move |event| {
if let Some(onclick) = onclick { if let Some(onclick) = onclick {

View File

@@ -19,35 +19,35 @@ pub(crate) fn CategoryInput(
SelectButton { SelectButton {
icon: FaLightbulb, icon: FaLightbulb,
is_selected: matches!(selected_category(), Category::SomedayMaybe), is_selected: matches!(selected_category(), Category::SomedayMaybe),
on_select: move |_| { on_select: move |()| {
selected_category.set(Category::SomedayMaybe); selected_category.set(Category::SomedayMaybe);
} }
} }
SelectButton { SelectButton {
icon: FaWater, icon: FaWater,
is_selected: matches!(selected_category(), Category::LongTerm), is_selected: matches!(selected_category(), Category::LongTerm),
on_select: move |_| { on_select: move |()| {
selected_category.set(Category::LongTerm); selected_category.set(Category::LongTerm);
} }
} }
SelectButton { SelectButton {
icon: FaHourglassHalf, icon: FaHourglassHalf,
is_selected: matches!(selected_category(), Category::WaitingFor(_)), is_selected: matches!(selected_category(), Category::WaitingFor(_)),
on_select: move |_| { on_select: move |()| {
selected_category.set(Category::WaitingFor(String::new())); selected_category.set(Category::WaitingFor(String::new()));
} }
} }
SelectButton { SelectButton {
icon: FaSignsPost, icon: FaSignsPost,
is_selected: matches!(selected_category(), Category::NextSteps), is_selected: matches!(selected_category(), Category::NextSteps),
on_select: move |_| { on_select: move |()| {
selected_category.set(Category::NextSteps); selected_category.set(Category::NextSteps);
} }
} }
SelectButton { SelectButton {
icon: FaCalendarDays, icon: FaCalendarDays,
is_selected: matches!(selected_category(), Category::Calendar { .. }), is_selected: matches!(selected_category(), Category::Calendar { .. }),
on_select: move |_| { on_select: move |()| {
selected_category.set(Category::Calendar { selected_category.set(Category::Calendar {
date: chrono::Local::now().date_naive(), date: chrono::Local::now().date_naive(),
reoccurrence: None, reoccurrence: None,
@@ -58,7 +58,7 @@ pub(crate) fn CategoryInput(
SelectButton { SelectButton {
icon: FaInbox, icon: FaInbox,
is_selected: matches!(selected_category(), Category::Inbox), is_selected: matches!(selected_category(), Category::Inbox),
on_select: move |_| { on_select: move |()| {
selected_category.set(Category::Inbox); selected_category.set(Category::Inbox);
} }
} }

View File

@@ -27,11 +27,11 @@ pub(crate) fn Input(
"text" | "number" => "", "text" | "number" => "",
_ => "enabled:cursor-pointer" _ => "enabled:cursor-pointer"
}, },
class.unwrap_or("".to_owned()) class.unwrap_or(String::new())
), ),
name: name.clone(), name: name.clone(),
r#type, r#type,
id: id.unwrap_or(format!("input_{}", name)), id: id.unwrap_or(format!("input_{name}")),
oninput: move |event| { oninput: move |event| {
if let Some(oninput) = oninput { if let Some(oninput) = oninput {
oninput.call(event); oninput.call(event);

View File

@@ -47,7 +47,7 @@ pub(crate) fn ProjectForm() -> Element {
name: "title", name: "title",
required: true, required: true,
r#type: "text", r#type: "text",
initial_value: project.as_ref().map(|project| project.title.to_owned()), initial_value: project.as_ref().map(|project| project.title.clone()),
} }
} }
} }

View File

@@ -14,28 +14,28 @@ pub(crate) fn ReoccurrenceIntervalInput(
SelectButton { SelectButton {
icon: FaBan, icon: FaBan,
is_selected: reoccurrence_interval().is_none(), is_selected: reoccurrence_interval().is_none(),
on_select: move |_| { on_select: move |()| {
reoccurrence_interval.set(None); reoccurrence_interval.set(None);
} }
} }
SelectButton { SelectButton {
icon: FaSun, icon: FaSun,
is_selected: matches!(reoccurrence_interval(), Some(ReoccurrenceInterval::Day)), is_selected: matches!(reoccurrence_interval(), Some(ReoccurrenceInterval::Day)),
on_select: move |_| { on_select: move |()| {
reoccurrence_interval.set(Some(ReoccurrenceInterval::Day)) reoccurrence_interval.set(Some(ReoccurrenceInterval::Day));
} }
} }
SelectButton { SelectButton {
icon: FaMoon, icon: FaMoon,
is_selected: matches!(reoccurrence_interval(), Some(ReoccurrenceInterval::Month)), is_selected: matches!(reoccurrence_interval(), Some(ReoccurrenceInterval::Month)),
on_select: move |_| { on_select: move |()| {
reoccurrence_interval.set(Some(ReoccurrenceInterval::Month)); reoccurrence_interval.set(Some(ReoccurrenceInterval::Month));
} }
} }
SelectButton { SelectButton {
icon: FaEarthEurope, icon: FaEarthEurope,
is_selected: matches!(reoccurrence_interval(), Some(ReoccurrenceInterval::Year)), is_selected: matches!(reoccurrence_interval(), Some(ReoccurrenceInterval::Year)),
on_select: move |_| { on_select: move |()| {
reoccurrence_interval.set(Some(ReoccurrenceInterval::Year)); reoccurrence_interval.set(Some(ReoccurrenceInterval::Year));
} }
} }

View File

@@ -306,7 +306,7 @@ pub(crate) fn TaskForm() -> Element {
name: "category_calendar_reminder_offset_index", name: "category_calendar_reminder_offset_index",
r#type: "range", r#type: "range",
min: 0, min: 0,
max: REMINDER_OFFSETS.len() as i64 - 1, max: REMINDER_OFFSETS.len() as i128 - 1,
initial_value: category_calendar_reminder_offset_index() initial_value: category_calendar_reminder_offset_index()
.to_string(), .to_string(),
oninput: move |event| { oninput: move |event| {
@@ -319,13 +319,14 @@ pub(crate) fn TaskForm() -> Element {
class: "pr-3 min-w-16 text-right", class: "pr-3 min-w-16 text-right",
r#for: "category_calendar_reminder_offset_index", r#for: "category_calendar_reminder_offset_index",
{REMINDER_OFFSETS[category_calendar_reminder_offset_index()] {REMINDER_OFFSETS[category_calendar_reminder_offset_index()]
.map( .map_or(
t!("none"),
|offset| if offset.num_hours() < 1 { |offset| if offset.num_hours() < 1 {
format!("{} min", offset.num_minutes()) format!("{} min", offset.num_minutes())
} else { } else {
format!("{} h", offset.num_hours()) format!("{} h", offset.num_hours())
} }
).unwrap_or_else(|| t!("none"))} )}
} }
} }
} }
@@ -359,7 +360,7 @@ pub(crate) fn TaskForm() -> Element {
delete_task(task.id).await delete_task(task.id).await
} else { } else {
let new_task = NewTask { let new_task = NewTask {
title: task.title.to_owned(), title: task.title.clone(),
deadline: task.deadline, deadline: task.deadline,
category: Category::Trash, category: Category::Trash,
project_id: task.project_id project_id: task.project_id

View File

@@ -14,7 +14,7 @@ use crate::{
}; };
fn use_on_document_become_visible(mut callback: impl FnMut() + 'static) { fn use_on_document_become_visible(mut callback: impl FnMut() + 'static) {
let callback = use_callback(move |_| callback()); let callback = use_callback(move |()| callback());
use_effect(move || { use_effect(move || {
spawn(async move { spawn(async move {
let mut eval = document::eval( let mut eval = document::eval(

View File

@@ -28,7 +28,7 @@ impl From<LocaleFromLanguageIdentifier<'_>> for Locale {
fn from(language_identifier: LocaleFromLanguageIdentifier) -> Self { fn from(language_identifier: LocaleFromLanguageIdentifier) -> Self {
language_identifier language_identifier
.to_string() .to_string()
.replace("-", "_") .replace('-', "_")
.parse() .parse()
.unwrap() .unwrap()
} }

View File

@@ -1,3 +1,5 @@
#![warn(clippy::pedantic)]
mod components; mod components;
mod dotenv; mod dotenv;
mod hooks; mod hooks;