From a760248ac6b3d707b0840d0f7b4af92322f9f639 Mon Sep 17 00:00:00 2001 From: Matt Norton Date: Mon, 8 Dec 2025 22:44:22 +0000 Subject: [PATCH] Add dotenv linter to pre-commit hooks --- .env.example | 13 +++---------- .pre-commit-config.yaml | 6 ++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.env.example b/.env.example index 107c80a60..54235e593 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,5 @@ +# dotenv-linter:off ValueWithoutQuotes + # !!REQUIRED!! # The Discord token for the bot you created (available on your bot page in the developer portal: https://discord.com/developers/applications)) # Must be a valid Discord bot token (see https://discord.com/developers/docs/topics/oauth2#bot-vs-user-accounts) @@ -34,12 +36,10 @@ MEMBERSHIP_PERKS_URL=[Replace with your group\'s membership-perks URL] # Must be a valid URL CUSTOM_DISCORD_INVITE_URL=[Replace with your group\'s Discord server invite link] - # The minimum level that logs must meet in order to be logged to the console output stream # One of: DEBUG, INFO, WARNING, ERROR, CRITICAL CONSOLE_LOG_LEVEL=INFO - # !!REQUIRED!! # The URL to retrieve the list of IDs of people that have purchased a membership to your community group # Ensure that all members are visible without pagination. For example, if your members-list is found on the UoB Guild of Students website, ensure the URL includes the "sort by groups" option @@ -52,17 +52,14 @@ ORGANISATION_ID=[Replace with your group\'s MSL Organisation ID] # This can be extracted from your web-browser, after logging in to view your members-list yourself. It will probably be listed as a cookie named `.AspNet.SharedCookie` SU_PLATFORM_ACCESS_COOKIE=[Replace with your .AspNet.SharedCookie cookie] - # The probability that the more rare ping command response will be sent instead of the normal one # Must be a float between & including 0 to 1 PING_COMMAND_EASTER_EGG_PROBABILITY=0.01 - # The path to the messages JSON file that contains the common messages sent by the bot # Must be a path to a JSON file that exists, that contains a JSON string that can be decoded into a Python dict object MESSAGES_FILE_PATH=messages.json - # Whether introduction reminders will be sent to Discord members that are not inducted, saying that they need to send an introduction to be allowed access # One of: Once, Interval, False SEND_INTRODUCTION_REMINDERS=Once @@ -94,7 +91,6 @@ SEND_GET_ROLES_REMINDERS_DELAY=40h # Must be a string of the seconds, minutes or hours between reminders (format: "smh") ADVANCED_SEND_GET_ROLES_REMINDERS_INTERVAL=24h - # The number of days to look over messages sent, to generate statistics data # Must be a float representing the number of days to look back through STATISTICS_DAYS=30 @@ -103,20 +99,17 @@ STATISTICS_DAYS=30 # Must be a comma seperated list of strings of role names STATISTICS_ROLES=Committee,Committee-Elect,Student Rep,Member,Guest,Server Booster,Foundation Year,First Year,Second Year,Final Year,Year In Industry,Year Abroad,PGT,PGR,Alumnus/Alumna,Postdoc,Quiz Victor - # !!REQUIRED!! # The URL of the your group's Discord guild moderation document # Must be a valid URL MODERATION_DOCUMENT_URL=[Replace with your group\'s moderation document URL] - # The name of the channel, that warning messages will be sent to when a committee-member manually applies a moderation action (instead of using the `/strike` command) # Must be the name of a Discord channel in your group's Discord guild, or the value "DM" (which indicates that the messages will be sent in the committee-member's DMs) # This can be the name of ANY Discord channel (so the offending person *will* be able to see these messages if a public channel is chosen) MANUAL_MODERATION_WARNING_MESSAGE_LOCATION=DM - # The set of roles that are tied to the membership of your community group # These roles will be removed along with the membership role upon annual handover/reset # Must be a comma seperated list of strings of role names -MEMBERSHIP_DEPENDENT_ROLES=member-red,member-blue,member-green,member-yellow,member-purple,member-pink,member-orange,member-grey,member-black,member-white \ No newline at end of file +MEMBERSHIP_DEPENDENT_ROLES=member-red,member-blue,member-green,member-yellow,member-purple,member-pink,member-orange,member-grey,member-black,member-white diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fbacdf595..e11e9e927 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,12 @@ default_language_version: default_stages: [pre-commit, pre-merge-commit, manual] repos: + - repo: https://github.com/dotenv-linter/dotenv-linter + rev: v4.0.0 + hooks: + - id: dotenv-linter + args: [fix, --no-backup] + - repo: https://github.com/hadolint/hadolint rev: v2.14.0 hooks: