cycle / database

Database Abstraction Layer, Schema Introspection, Schema Generation, Query Builders
MIT License
53 stars 22 forks source link

feat: add automation, linting and improve DX #171

Closed lotyp closed 3 months ago

lotyp commented 3 months ago

feat: introduce self-documenting Makefile for package development

This update introduces a self-documenting Makefile as a single entry point for developers working on the package, streamlining the development process and enhancing usability.

feat: add pre-commit with multiple hooks for code quality assurance

Pre-commit has been added to the development workflow to automatically check and fix common issues before commits are made. The included hooks are:

feat: implement commitizen for conventional commits

Commitizen has been integrated to facilitate the use of conventional commits, paving the way for an automated CHANGELOG.md via googleapis/release-please.

chore: reorganize CODE_OF_CONDUCT.md to .github directory

Moving CODE_OF_CONDUCT.md to the .github directory declutters the main folder and aligns with GitHub's best practices for repository organization.

feat: streamline environment setup with .env example and Makefile

Added .env.example and integrated .env building through Makefile, leveraging Docker to expedite environment setup for developers.

feat: add .yamllint.yaml for YAML file linting

Introduced a .yamllint.yaml configuration file to lint YAML files, enhancing code quality and consistency.

feat: replace StyleCI with local wayofdev/cs-fixer-config for PHP linting

Switched from cloud-based StyleCI to a local solution using wayofdev/cs-fixer-config, a php-cs-fixer wrapper package. This allows developers to perform PHP linting locally via Makefile, reducing reliance on cloud-based CI systems.

feat: update docker-compose for enhanced development and testing

Updated docker-compose.yaml to support PHP 8.2 and various database servers directly through Makefile and in tests, enabling developers to avoid local PHP installations.

lotyp commented 3 months ago

Simplified Dev Workflow with make

This PR introduces a streamlined dev workflow using the make command. Running make locally sets up dev environment in a snap:

  1. make env: Creates the .env file from .env.example.
  2. make prepare: Sets up the .build/php-cs-fixer directory for caching.
  3. make install: Runs composer install using Docker with wayofdev/php-dev:8.2-cli-alpine-latest.
  4. make hooks: Installs pre-commit git hooks for linting and commitizen.
  5. make up: Starts the Docker environment with all the necessary databases.

No more manual setup or inconsistencies across dev environments! Check out the asciicast to see make in action:

asciicast

Added make help command

This command prints available actions on this repository:

asciicast

Let's make our dev lives easier with this addition!

lotyp commented 3 months ago

Closed in favor of https://github.com/cycle/database/pull/173