From 26acf7589a0480edd570c1852cc2b397c0077aa5 Mon Sep 17 00:00:00 2001 From: Thomas SharedInbox Date: Sun, 10 May 2026 10:48:18 +0200 Subject: [PATCH] chore: strengthen git safeguards and remove tracked .metadata --- .gitignore | 71 ++++++++++++++++++++--------------------- .metadata | 30 ----------------- .pre-commit-config.yaml | 17 ++++++++++ Taskfile.yml | 16 +++++++++- 4 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 .metadata diff --git a/.gitignore b/.gitignore index ae6e6da..30e8a35 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Flutter/Dart +# --- Flutter/Dart --- coverage/ .dart_tool/ .dart-tool/ @@ -8,27 +8,33 @@ build/ *.g.dart *.freezed.dart -# IDE +# --- IDEs --- .idea/ .vscode/ *.iml -# OS +# --- OS / System --- .DS_Store Thumbs.db -# Local environment overrides (copied from .env.example) +# --- Environment & Secrets --- .env .env.local +.envrc +.direnv/ -# Android +# --- Android --- android/.gradle/ android/local.properties android/app/google-services.json android/key.properties android/app/src/main/java/io/flutter/plugins/ +.android/ +Android/ +.gradle/ +.emulator_console_auth_token -# iOS +# --- iOS --- ios/Pods/ ios/Flutter/Generated.xcconfig ios/Flutter/ephemeral/ @@ -36,58 +42,51 @@ ios/Flutter/flutter_export_environment.sh ios/Runner/GeneratedPluginRegistrant.* *.xcworkspace/ -# macOS +# --- macOS --- macos/Pods/ macos/Flutter/GeneratedPluginRegistrant.swift macos/Flutter/ephemeral/ -# Linux generated plugin wiring (recreated by flutter pub get) +# --- Linux --- linux/flutter/ephemeral/ linux/flutter/generated_plugin_registrant.* linux/flutter/generated_plugins.cmake -# Flutter generated metadata +# --- Flutter Metadata --- .flutter-plugins .flutter-plugins-dependencies +.metadata -# direnv cache -.direnv/ - -# FVM — .fvmrc is committed; .fvm/ contains the downloaded SDK (not committed) +# --- Tools & Cache --- .fvm/ fvm/ .qwen .claude - .task - -*.log -runner-data/ -sharedinbox-runner/runner-data/ - .atuin/ -.bash_logout -.bashrc .cache/ .config/ .local/ .nix-profile .npm/ -.profile -.ssh/ -.zcompdump -.zshrc -snap/ -.gitconfig -.gemini/ -.dartServer/ .pub-cache/ -.android/ -Android/ -.gradle/ -.emulator_console_auth_token -.lesshst -.metadata -.tmux.conf +.dartServer/ .flutter .dart-cli-completion/ +snap/ + +# --- User Configuration (Home Dir Junk) --- +.bash_logout +.bashrc +.profile +.zcompdump +.zshrc +.gitconfig +.lesshst +.tmux.conf +.ssh/ + +# --- Logs & Data --- +*.log +runner-data/ +sharedinbox-runner/runner-data/ diff --git a/.metadata b/.metadata deleted file mode 100644 index a8104ff..0000000 --- a/.metadata +++ /dev/null @@ -1,30 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "db50e20168db8fee486b9abf32fc912de3bc5b6a" - channel: "stable" - -project_type: app - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a - base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a - - platform: android - create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a - base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a80bec2..18b6d38 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,23 @@ repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-added-large-files + args: ['--maxkb=500'] + - id: check-merge-conflict + - id: check-case-conflict + - id: detect-private-key + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: local hooks: + - id: forbidden-files-hook + name: check for forbidden home-directory files + language: system + entry: task check-hygiene + pass_filenames: false + always_run: true - id: dart-check name: dart format (autofix) + check-fast (parallel) language: system diff --git a/Taskfile.yml b/Taskfile.yml index 53e593d..a99b457 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -304,7 +304,21 @@ tasks: check-fast: desc: Pre-commit checks — analyze + unit tests + widget tests (no build, no integration) - deps: [analyze, test, test-widget] + deps: [analyze, test, test-widget, check-hygiene] + + check-hygiene: + desc: Verify that no forbidden files (like home dir config) are tracked + cmds: + - | + FORBIDDEN=".ssh .bashrc .config .local .cache .gitconfig .android Android .gradle .pub-cache .dartServer .flutter .dart-cli-completion .atuin .bash_logout .profile .zcompdump .zshrc snap .emulator_console_auth_token .lesshst .metadata .tmux.conf" + TRACKED=$(git ls-files $FORBIDDEN 2>/dev/null) + if [ -n "$TRACKED" ]; then + echo "ERROR: The following forbidden files are tracked in git:" + echo "$TRACKED" + echo "Please remove them with 'git rm --cached '" + exit 1 + fi + echo "Hygiene check passed." _integrations: internal: true