Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should not log succes message when app.option('silent') #1

Open
rbecheras opened this issue Jan 5, 2018 · 7 comments
Open

Should not log succes message when app.option('silent') #1

rbecheras opened this issue Jan 5, 2018 · 7 comments

Comments

@rbecheras
Copy link
Member

rbecheras commented Jan 5, 2018

For better readable tests, the generator should not log succes message when app.option('silent')
See:

app.log.success('first commit');

@rbecheras
Copy link
Member Author

rbecheras commented Jan 5, 2018

Exemple of my tests without running generate-git:



  generate-swap-project
    plugin
      ✓ should add tasks to the instance (109ms)
      ✓ should only register the plugin once

  generate-swap-project
    tasks
      ✓ should extend tasks onto the instance
      ✓ should run the `default` task with .build (177ms)
      ✓ should run the `default` task with .generate
    swap-project (CLI)
      ✓ should run the default task using the `generate-swap-project` name (global install)
      ✓ should run the default task using the `swap-project` generator alias (local generator.js)
    swap-project (API)
      ✓ should run the default task on the generator
      ✓ should run the `swap-project` task
      ✓ should run the `default` task when defined explicitly
    sub-generator
      ✓ should work as a sub-generator
      ✓ should run the `default` task by default
      ✓ should run the `generator:default` task when defined explicitly
      ✓ should run the `generator:project` task when defined explicitly
      ✓ should work with nested sub-generators
      ✓ should run tasks as a sub-generator


  16 passing (2s)

and the same tests running generate-git:



  generate-swap-project
    plugin
      ✓ should add tasks to the instance (109ms)
      ✓ should only register the plugin once

  generate-swap-project
    tasks
      ✓ should extend tasks onto the instance
[00:22:40] ✔ first commit
      ✓ should run the `default` task with .build (393ms)
[00:22:40] ✔ first commit
      ✓ should run the `default` task with .generate (189ms)
    swap-project (CLI)
[00:22:40] ✔ first commit
      ✓ should run the default task using the `generate-swap-project` name (global install) (208ms)
[00:22:40] ✔ first commit
      ✓ should run the default task using the `swap-project` generator alias (local generator.js) (201ms)
    swap-project (API)
[00:22:40] ✔ first commit
      ✓ should run the default task on the generator (186ms)
[00:22:41] ✔ first commit
      ✓ should run the `swap-project` task (200ms)
[00:22:41] ✔ first commit
      ✓ should run the `default` task when defined explicitly (193ms)
    sub-generator
[00:22:41] ✔ first commit
      ✓ should work as a sub-generator (208ms)
[00:22:41] ✔ first commit
      ✓ should run the `default` task by default (186ms)
[00:22:41] ✔ first commit
      ✓ should run the `generator:default` task when defined explicitly (230ms)
[00:22:42] ✔ first commit
      ✓ should run the `generator:project` task when defined explicitly (194ms)
[00:22:42] ✔ first commit
      ✓ should work with nested sub-generators (260ms)
      ✓ should run tasks as a sub-generator


  16 passing (3s)

is shown

@jonschlinkert
Copy link
Member

agreed, want to do a PR?

@jonschlinkert
Copy link
Member

I think we just need to address this line:

app.log.success('first commit');
. does that look correct to you?

@rbecheras
Copy link
Member Author

Yes it does ;-)

capture d ecran de 2018-01-15 22-44-27

Yes I'll do a PR

@rbecheras
Copy link
Member Author

@jonschlinkert How did do to include the line looking like a gist in your github comment ? I dont know that feature of the github UI.

@doowb
Copy link
Member

doowb commented Jan 23, 2018

@rbecheras if you select the line of code when looking at it on GitHub then copy/paste the url into the comment, it should show up like that. I think it's a feature something GitHub just added recently.

@rbecheras
Copy link
Member Author

@doowb thanks!

Ok I just tested it updating my the first comment (the original post) of this issue.

In fact, it seems it works only if the link contains the commit hash but not if the ref name is used, like the branch name.

Example:

// this does not work
https://github.com/generate/generate-git/blob/master/generator.js#L62

// but this works
https://github.com/generate/generate-git/blob/b3f04aa5e9e1af9c87fda37a09a3d66a229a1b70/generator.js#L62

Thanks!

Its a pretty cool new feature ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants