Coder Social home page Coder Social logo

whisky's Introduction

Hi there ๐Ÿ‘‹

whisky's People

Contributors

faissaloux avatar gpibarra avatar projektgopher avatar sebastianstucke87 avatar us3r001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

whisky's Issues

"Ambiguous class resolution" when installing on standard Laravel application.

Not entirely an issue since none of the code in this repository needs to be loaded in, but this warning does get generated when installing Whisky over the standard laravel/laravel template that also uses the "App" namespace:

Warning: Ambiguous class resolution, "App\Providers\AppServiceProvider" was found in both "/home/vagrant/project/app/Providers/AppServiceProvider.php" and "/home/vagrant/project/vendor/projektgopher/whisky/app/Providers/AppServiceProvider.php", the first will be used.

[Windows Support] Run hook - bad path

  • git hook run pre-commit
.git/hooks/pre-commit: line 2: C:UsersmarkrSourceReposcampsvendor/projektgopher/whisky/bin/run-hook: No such file or directory

The example from README.md is not working

I tried to run whisky in a new Laravel project but I got the following errors:

.git/hooks/pre-commit: line 3: In: command not found
.git/hooks/pre-commit: eval: line 5: syntax error near unexpected token `:'
.git/hooks/pre-commit: eval: line 5: `  in_array(): Argument #2 ($haystack) must be of type array, null given  '

I used the same code as in example.

Failing test doesn't prevent git push

Hi, I'm experiencing an issue where a failed unit test isn't preventing a push.

It's also worth noting that I get the two following lines before the tests start running:

stty: stdin isn't a terminal
stty: stdin isn't a terminal

Here's my whisky.json file contents:

{
  "disabled": [],
  "hooks": {
    "pre-commit": [
      "./vendor/bin/pint"
    ],
    "pre-push": [
      "php artisan test --parallel",
      "./vendor/bin/phpstan analyse"
    ],
    "post-checkout": [
      "composer install",
      "php artisan optimize:clear"
    ]
  }
}

And here's the command line output:

11:03:40 in vapour on ๎‚  feature/bottling-module [โ‡ก]
โžœ git push
stty: stdin isn't a terminal
stty: stdin isn't a terminal
ParaTest v7.2.0 upon PHPUnit 10.2.2 by Sebastian Bergmann and contributors.

Processes:     8
Runtime:       PHP 8.2.5
Configuration: /Users/stephenhamilton/Sites/vapour/phpunit.xml

...............................................................  63 / 416 ( 15%)
............................................................... 126 / 416 ( 30%)
............................................................... 189 / 416 ( 45%)
..........................................................I.... 252 / 416 ( 60%)
.......I.I..................................................... 315 / 416 ( 75%)
................................F.............................. 378 / 416 ( 90%)
......................................                          416 / 416 (100%)

Time: 01:25.270, Memory: 62.50 MB

There was 1 failure:

1) Tests\Feature\Tasks\SampleTest::test_completing_sample_task
Failed asserting that 13.1 matches expected 13.100000000000001.

/Users/stephenhamilton/Sites/vapour/tests/Feature/Tasks/SampleTest.php:184
/Users/stephenhamilton/Sites/vapour/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:174

FAILURES!
Tests: 416, Assertions: 57498, Failures: 1, Incomplete: 3.
Note: Using configuration file /Users/stephenhamilton/Sites/vapour/phpstan.neon.
 753/753 [โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“] 100%



 [OK] No errors


Enumerating objects: 11, done.
Counting objects: 100% (11/11), done.
Delta compression using up to 8 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 623 bytes | 623.00 KiB/s, done.
Total 6 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
To github.com:speysidelabs/vapour.git
   8dbae0ea..054f9095  feature/bottling-module -> feature/bottling-module

[ Fix ][ Global ] Validate Command

> composer global require projektgopher/whisky:0.5.0-alpha.1
> whisky validate

Whisky has not been initialized in this project, aborting...
Run `./vendor/bin/whisky install` to initialize Whisky in this project.

If Whisky::isRunningGlobally() is true, the bin in that command output (and other similar ones) should be simply whisky.

[ Bug ] Unhandled behaviour when switching to branch without whisky

Whisky installed globally, but switched to branch where whisky has not been required through composer, and whisky.json is not present, however the hooks have been installed.

Because the hooks directory, and the vendor bin directory remain untouched when switching between branches, we can still run whisky, but get the following output:

โฏ git hook run pre-commit
.git/hooks/pre-commit: line 3: In: command not found
does:                                            cannot open `does' (No such file or directory)
not:                                             cannot open `not' (No such file or directory)
exist:                                           cannot open `exist' (No such file or directory)
at:                                              cannot open `at' (No such file or directory)
path:                                            cannot open `path' (No such file or directory)
/Users/gopher/Code/EXACTsports/camps/whisky.jso: cannot open `/Users/gopher/Code/EXACTsports/camps/whisky.jso' (No such file or directory)
.git/hooks/pre-commit: line 6: n.: command not found

both global whisky, and vendor/bin/whisky run, returning the correct version.

This should be as easy as having the get-run-cmd Command check for whisky.json just like the Install/Uninstall/Update commands do.

โฏ ./vendor/bin/whisky get-run-cmd pre-commit

In Filesystem.php line 59:
                                                                                 
  File does not exist at path /Users/gopher/Code/EXACTsports/camps/whisky.json.  
                                                                                 

edit:
I think we could take two approaches here. Either fail silently by not returning anything in the get-run-cmd output, or we'll have to rewrite the snippet that gets added to the git hook file, and support another new snippet in Whisky::isInstalled() et all. This could be a bit tougher due to the multi-line nature the new snippet would implement. Needs discussion.

[ Feat ] Pint

We should define a code style, apply it using our own hooks, and enforce it in CI

[ Fix ][ Global ] Install Command

โฏ whisky install
Creating whisky.json in project root...

In Filesystem.php line 59:

  File does not exist at path /Users/gopher/Code/git-test/vendor/projektgopher/whisky/stubs/whisky.json.

[Bug] Can't run global `whisky install` on WAMP

Environment

  • OS: Windows 10
  • Shell: PowerShell, Batch, Bash(git - MINGW64)
  • PHP version: 8.1
  • Whisky version: 0.5.1

Step to reproduce

# install global
composer global require projektgopher/whisky

# new repo
mkdir test
cd test
git init 
composer init -n --name=test/test --autoload=src/
echo /vendor/ >> .gitignore
git add .
git commit -m "first commit"

# install whisky.json using global package
whisky install

Error

In Filesystem.php line 59:

  File does not exist at path C:/develop/projects/gepe/vendor/projektgopher/whisky/stubs/whisky.json.

Audit

key value
- Whisky -
installed globally? yes
running globally? no
dogfooding? no
base path C:/develop/projects/test/vendor/projektgopher/whisky/
bin path C:/develop/projects/test/vendor/bin/whisky
- Platform -
cwd C:/develop/projects/test
getGlobalComposerHome C:\Wamp.NET\bin.php\composerHome
getGlobalComposerBinDir C:\Wamp.NET\bin.php\composerHome/vendor/bin
isWindows yes
isNotWindows no
gitIsInitialized yes
gitIsNotInitialized no
- global -
base_path phar://C:/Wamp.NET/bin/7-php_8.1.0_x64/composerHome/vendor/projektgopher/whisky/builds/whisky
normalized base_path phar://C:/Wamp.NET/bin/7-php_8.1.0_x64/composerHome/vendor/projektgopher/whisky/builds/whisky

Issue with Pest Architecture Testing after installation

After installing this package and setting it up, I'm getting my global architecture tests failing. I get this error:

./vendor/bin/pest tests/Feature/ArchTest.php         

   FAIL  Tests\Feature\ArchTest
  โœ“ controllers                                         0.21s  
  โจฏ globals                                             0.34s  
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  
   FAILED  Tests\Feature\ArchTest > globals            Error   
  Typed property PHPUnit\Architecture\Asserts\Dependencies\ObjectDependenciesDescription::$uses must not be accessed before initialization

  at vendor/ta-tikoma/phpunit-architecture-test/src/Asserts/Dependencies/DependenciesAsserts.php:70
     66โ–•         $result = [];
     67โ–• 
     68โ–•         foreach ($layers as $layer) {
     69โ–•             foreach ($layer as $object) {
  โžœ  70โ–•                 foreach ($object->uses as $use) {
     71โ–•                     foreach ($layersToSearch as $layerToSearch) {
     72โ–•                         // do not test layer with self
     73โ–•                         if ($layer->equals($layerToSearch)) {
     74โ–•                             continue;



  Tests:    1 failed, 1 passed (7 assertions)
  Duration: 0.61s

https://pestphp.com/docs/arch-testing

Here is the whole test:

<?php

test('controllers')
    ->expect('App\Http\Controllers')
    ->not->toUse('Illuminate\Http\Request');

test('globals')
    ->expect(['dd', 'dump', 'ray'])
    ->not->toBeUsed();

Prior to whisky install, they all pass:

php artisan test

   PASS  Tests\Unit\ExampleTest
  โœ“ that true is true                                                                                                                                            0.01s

   PASS  Tests\Feature\ArchTest
  โœ“ controllers                                                                                                                                                  0.08s
  โœ“ globals                                                                                                                                                      0.03s

   PASS  Tests\Feature\ExampleTest
  โœ“ it returns a successful response                                                                                                                             0.02s

  Tests:    4 passed (12 assertions)
  Duration: 0.18s

I created this repo that can be used to replicate the problem:
https://github.com/TappNetwork/whisky-pest

To replicate:

  • Clone repo
  • composer install
  • php artisan test

See the failure.

[Windows Support] Install Command - chmod not recognized

  • whisky install
Creating whisky.json in project root...
'chmod' is not recognized as an internal or external command,
operable program or batch file.
'chmod' is not recognized as an internal or external command,
operable program or batch file.
Git hooks installed successfully.

[Not issue] - commitlint

Hi, that's not an issue.
I searched for a way to run commitlint using whisky without luck.

My whisky.json is:

{
  "disabled": [],
  "hooks": {
    "pre-commit": [
      "npx --no -- commitlint --edit ${1}",
      "composer format",
      "bash ./local/pre-commit/prettier.sh",
      "bash ./local/pre-commit/stylelint.sh"
    ],
    "pre-push": [
      "composer test"
    ]
  }
}

I am getting the following errors. I am 100% missing something, but I can't get it.

/Users/dev/local.test/node_modules/@commitlint/cli/lib/cli.js:123
        throw err;
        ^

[Error: ENOENT: no such file or directory, open '/Users/dev/local.test/pre-commit'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/dev/local.test/pre-commit'
}

Thank you

can't build on `Windows`

The app builds well on Linux but when I try building it on Windows for testing/developing I got an error related to SIGINT and it is coming from laravel-zero/framework, when I checked it I found that they have fixed it on PR, but not yet released.

laravel-zero/framework needs a bump, I'll wait for the release to do it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.