larapack / hooks

Hooks is a extension system for your Laravel application.
https://larapack.io
MIT License
218 stars 15 forks source link

composer.json broke by hook setup #41

Closed sinkcup closed 5 years ago

sinkcup commented 5 years ago

Description:

composer.json broke by hook setup

Steps To Reproduce:

php artisan hook:setup
git diff composer.json

Error: No newline at end of file

image

fletch3555 commented 5 years ago

Same as the Voyager issue you created... uhhh what?

There's no error in your screenshot

sinkcup commented 5 years ago

Error: No newline at end of file

do you known Git/Linux/Mac demand "every line in text should end with a line break"?

fletch3555 commented 5 years ago

Does it cause you any problems? Thats not a "demand" as much as it is a "standard". If it's not causing problems (which I know its not since 1000's of devs have been using this for over a year), then just ignore it. Or add it back yourself

sinkcup commented 5 years ago

It makes big problem: composer.json be changed for nothing, add rubbish history to git, git warning, code can't commit.

As a programmer, you should follow standards, break rules.

I have fixed it, check the PR.

fletch3555 commented 5 years ago

It doesn't add anything to git, that's on you as the dev. You're welcome to add the line before committing if you so desire. There's no got warning at all, not will it block you from committing other changes.

I'm not saying you (we) shouldn't follow standards. What I am saying is that you're making a huge deal out of nothing

sinkcup commented 5 years ago

There is testing before commit, you known?

Every time I run php artisan voyager:install && phpunit, then composer.json changed, you say it's nothing?

php artisan voyager:install
phpunit #success
git add .
git commit -m 'new a feature'
pre-commit Error: No newline at end of file
git push origin xxx
CI Error: No newline at end of file
Review request changes: Why you delete the line break of `composer.json`? Are U OK?
fletch3555 commented 5 years ago

We have no control over any pre-commit hooks you may have added to your project. There is nothing in the core functionality of git that would block the commit simply for a missing newline at the end of a file. Git simply doesn't care.

sinkcup commented 5 years ago

this install changes composer.json, whatever the content, git care changes.

your bug trouble all developers, every time "change back manually" is not a good idea.

sinkcup commented 5 years ago

@emptynick is anybody there?

emptynick commented 5 years ago

your bug trouble all developers

You are the first one with troubles because of this

sinkcup commented 5 years ago

ha ha. in any case, a package should not change my composer.json

emptynick commented 5 years ago

If you dont want hooks to change your composer.json (what it does when installing/uninstalling hooks), remove it. There's no other way to include/autoload hooks.

sinkcup commented 5 years ago

I had fix it, check the PR https://github.com/larapack/hooks/pull/42

sinkcup commented 5 years ago

bug is bug, small bug is bug too. Don't look for any excuses.