imgix-php icon indicating copy to clipboard operation
imgix-php copied to clipboard

config: update repo config files and documents

Open adevade opened this issue 2 years ago • 3 comments

Description

.editorconfig

Helps contributors by making sure their editor is behaving according to our specifications. More info

.gitattributes

Ignores repo files and tests when exporting this project. For example, when downloading as .zip or when installing via composer. This helps save a few hundred kilobytes for every install.

Examples from other popular PHP projects:

composer.json

Remove version field. This is handled automatically by packagist.org with the branches/tags/releases in this repo. This way, you only need to update the version numer in one place for each new release; the constant UrlBuilder::VERSION.

The easiest way to manage versioning is to just omit the version field from the composer.json file. The version numbers will then be parsed from the tag and branch names. Source

Other changes:

  • Use 4 spaces indentation instead of 2
  • Reorder some fields
  • Add useful links to documentation and repository
  • Add custom scripts for formatting and testing
  • Add common config values, see laravel-framework and package-skeleton
  • Update dependencies and commit composer.lock (Related issue #113)

CONTRIBUTING.md

Mostly formatting, fixing a broken link to Code of Conduct and clarifying the composer commands at the bottom. Also using the newly added composer custom script for running the tests.

pint.json

Update preset from psr12 to laravel. The laravel preset is based on psr12 with some other quality of life improvements. Formatting the code in its current state has no difference between the presets.

Another preset available is symfony. I don't like that one personally. Mostly because it uses "Yoda style" conditions. Ex: if ($meaning === 42) becomes if (42 === $meaning).

Checklist

  • [x] Read the contributing guidelines.
  • [x] Each commit follows the Conventional Commit spec format.
  • [x] Update the readme.
  • [x] All existing unit tests are still passing.

adevade avatar Feb 01 '23 10:02 adevade

Config

  • add .editorconfig file (271b182)
  • add .gitattributes file (09a6fc0)
  • change to laravel preset for pint (6c82691)
  • reindent composer.json with 4 spaces (4fc0545)
  • reorder composer keys (1fa040b)
  • remove version from composer.json (0d2053d)
  • add links to composer.json (957a865)
  • add common settings to composer.json (2977413)
  • add custom scripts to composer.json (65d3910)
  • reference composer script in contribute.md (fd42dc6)
  • handle line endings same on all systems (de5a1d3)
  • use 2 space indentation for yaml (e4da087)

Documentation

Chore

Contributors

adevade

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

commit-lint[bot] avatar Feb 01 '23 10:02 commit-lint[bot]

Hey @adevade , same comment as in #111 , any guidance on the "right" way of reading the diff would be great.

Thanks again for your hard work on this, we'll leave you feedback as soon as we're able.

luqven avatar Feb 01 '23 17:02 luqven

@luqven This one should be fine to just read the diff, paired with my notes in the original comment.

The updates to composer.json has very detailed commits of what I changed, so config: reindent composer.json with 4 spaces to config: add custom scripts to composer.json could be read commit by commit for extra clarity.

adevade avatar Feb 01 '23 17:02 adevade