Skip to content

Latest commit

 

History

History
201 lines (151 loc) · 4.44 KB

File metadata and controls

201 lines (151 loc) · 4.44 KB

Contributing

Thank you for considering contributing to PHP Quality Tools!

Code of Conduct

This project follows the Contributor Covenant Code of Conduct. By participating, you are expected to uphold it. Please report unacceptable behavior to hectorfranco@nowo.tech.

Table of contents

Maintainer

This project is maintained by Héctor Franco Aceituno at Nowo.tech.

Development Setup

Using Docker (Recommended)

  1. Clone the repository:

    git clone https://github.com/nowo-tech/PhpQualityTools.git
    cd php-quality-tools
    
  2. Start the Docker container:

    make up
    
  3. Install dependencies:

    make install
    
  4. Run tests:

    make test
    

Without Docker

  1. Clone the repository:

    git clone https://github.com/nowo-tech/PhpQualityTools.git
    cd php-quality-tools
    
  2. Install dependencies:

    composer install
    
  3. Run tests:

    composer test
    

Pull Request Process

  1. Fork the repository
  2. Create a feature branch from develop:
    git checkout develop
    git pull origin develop
    git checkout -b feature/amazing-feature
    
  3. Make your changes
  4. Run tests and code style checks:
    make qa
    # or without Docker:
    composer qa
    
  5. Commit your changes following Conventional Commits:
    git commit -m 'feat(scope): add amazing feature'
    
  6. Push to the branch:
    git push origin feature/amazing-feature
    
  7. Open a Pull Request to develop (not main)

Coding Standards

  • Follow PSR-12 coding style
  • Add tests for new features
  • Update documentation as needed
  • Keep commits atomic and descriptive
  • Update docs/CHANGELOG.md with compatibility information

Running Tests

With Docker

# Run all tests
make test

# Run tests with coverage
make test-coverage

# Check code style
make cs-check

# Fix code style
make cs-fix

# Run all QA checks
make qa

Without Docker

# Run all tests
composer test

# Run tests with coverage
composer test-coverage

# Check code style
composer cs-check

# Fix code style
composer cs-fix

Adding Framework Support

When adding support for a new framework:

  1. Create framework directory: config/{framework}/
  2. Add framework detection in Plugin::FRAMEWORK_PACKAGES
  3. Create framework-specific config files
  4. Add tests for framework detection
  5. Update README.md with framework compatibility
  6. Update docs/CHANGELOG.md with PHP and framework versions

Version Compatibility

When releasing a new version, always document:

  • PHP versions supported
  • Framework versions supported (Symfony, Laravel, etc.)
  • Breaking changes (if any)

Example in CHANGELOG:

## [1.1.0] - 2024-12-15

### Compatibility
- **PHP**: >= 8.1
- **Symfony**: 6.0 - 7.4
- **Laravel**: 9.0 - 11.0

Reporting Issues

When reporting issues, please include:

  • PHP version
  • Framework and version (Symfony, Laravel, etc.)
  • Composer version
  • Operating system
  • Steps to reproduce
  • Expected vs actual behavior

Contact

For questions or suggestions, you can reach out to:

Git hooks (REQ-GIT-001)

Do not add Co-authored-by: Cursor or cursoragent@cursor.com trailers to commit messages.

make setup-hooks
make check-no-cursor-coauthor

make setup-hooks installs .githooks/commit-msg (or sets core.hooksPath to .githooks). Run it once per clone before your first commit. If CI fails because trailers are already on the remote, see GITHUB_CI.md (REQ-GIT-001) and run make strip-cursor-coauthor-from-history before git push --force-with-lease.