Skip to content

feat: add pre-commit hook and enforce strict types across files#68

Merged
danielhe4rt merged 2 commits into3.xfrom
feat/add-pre-commit-and-enforce-strict-types
Oct 30, 2025
Merged

feat: add pre-commit hook and enforce strict types across files#68
danielhe4rt merged 2 commits into3.xfrom
feat/add-pre-commit-and-enforce-strict-types

Conversation

@gvieira18
Copy link
Member

This pull request introduces several improvements across the codebase, focusing on enforcing stricter typing, enhancing immutability, and standardizing code style. The changes primarily affect the authentication and character modules, with additional updates to code formatting and development tooling.

Code Quality and Type Safety Improvements:

  • Added declare(strict_types=1); to the top of multiple PHP files across the Heart/Authentication/OAuth and Heart/Character domains to enforce strict type checking.
  • Converted several service and action classes to final and/or readonly classes to improve immutability and prevent unintended inheritance or modification.
  • Refactored constructors to use property promotion and simplified method bodies, improving code clarity and reducing boilerplate.

Development Tooling and Code Style:

  • Added .prettierrc and .prettierignore files to enforce consistent code formatting, including support for Blade and Tailwind CSS plugins.
  • Updated .editorconfig to set tab indentation for Makefiles and .mk files, replacing previous docker-compose-specific settings.
  • Introduced a .husky/pre-commit hook to run lint-staged before commits, helping catch formatting issues early.

Workflow and Environment Consistency:

  • Standardized the use of single quotes in environment variables within the Laravel GitHub Actions workflow for migration and testing steps.

These changes collectively enhance code reliability, maintainability, and developer experience across the project.

- add pre-commit hook for linting
- declare strict types in multiple PHP files
- update composer.json and package.json for new dependencies
@gvieira18 gvieira18 self-assigned this Oct 30, 2025
@danielhe4rt danielhe4rt merged commit 9caa312 into 3.x Oct 30, 2025
1 check failed
@danielhe4rt danielhe4rt deleted the feat/add-pre-commit-and-enforce-strict-types branch October 30, 2025 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants