# Using grunt when contributing

**URL:** <https://discourse.nodered.org/t/using-grunt-when-contributing/25519>\
**Category:** Core Development\
**Created:** [26 April 2020 06:29 UTC](https://discourse.nodered.org/t/using-grunt-when-contributing/25519 "2020-04-26T06:29:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [26 April 2020 06:29 UTC](https://discourse.nodered.org/t/using-grunt-when-contributing/25519/1 "2020-04-26T06:29:37Z")

</div>

Hi folks,

This must be a silly question, because all other contributors seem to understand it (except me)...

Would like to create a pull-request for Node-RED, but _ **grunt** _ is mentioned in the checklist:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/b/9bab73f1e395da95246a569af3f29691ba1efe0d.png)

Have followed all the steps from development [getting-started](https://nodered.org/docs/getting-started/development) tutorial, and indeed it asks to install grunt and build the project with grunt.

When I build with grunt, then it says in green letters _"Done"_. So I assumed first that I did a good job. However when looking in Node-RED's Gruntfile.js it seems that it also includes a.o. _ **jshint** _ (for Javascript code quality checking):

```auto
jshint: {
   options: {
      ...
   }
}

```

So I assume it can also check automatically whether I have followed the Node-RED [coding standards](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md#coding-standards) correctly. And more stuff (like unit tests ...) that I really should run before releasing my pull request. But when I explicit change my code to a nasty format, don't see an error or warning somewhere ☹

Can anybody please explain which commands I should run, where I can find the output. So everything that I should do before releasing the pull request.

Thanks!!!  
Bart

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [26 April 2020 08:00 UTC](https://discourse.nodered.org/t/using-grunt-when-contributing/25519/2 "2020-04-26T08:00:40Z")

</div>

You just run `grunt` with no arguments and it will build the code and run the unit tests. Is that not what you see?

The jshint task is only applied to the editor code.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [26 April 2020 08:25 UTC](https://discourse.nodered.org/t/using-grunt-when-contributing/25519/3 "2020-04-26T08:25:03Z")

</div>

> [@knolleary](#):
>
> You just run `grunt` with no arguments and it will build the code and run the unit tests

Ah how stupid. Now indeed I see the unit tests running. Thanks!

> [@knolleary](#):
>
> The jshint task is only applied to the editor code

I assume you mean this entry in the log:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/3/633a41c03280536743d60fd4374e42fbfef1e6bd.png)

I wanted to check my changes in the red.js file (for automatic https renewal feature), to see whether I followed the coding standards correctly.  
It is listed in the table at the end:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/b/1be3dec8a8196addad3250d2538f034f653af46d.png)

But I "assume" that is then only about code coverage (and not about code quality)?  
Would just like to check easily whether my changes are good enough to go (and of course that I don't break anything).

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [26 April 2020 08:30 UTC](https://discourse.nodered.org/t/using-grunt-when-contributing/25519/4 "2020-04-26T08:30:13Z")

</div>

> [@BartButenaers](#):
>
> Would just like to check easily whether my changes are good enough to go (and of course that I don't break anything).

Well the `grunt` task isn't the _only_ measure we use of whether changes are good to merge... we haven't completely replaced the need for human review of proposed changes 😉

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [26 April 2020 08:41 UTC](https://discourse.nodered.org/t/using-grunt-when-contributing/25519/5 "2020-04-26T08:41:13Z")

</div>

> [@knolleary](#):
>
> human review

Oh nooo 🤣 Thanks!!!

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [1 May 2020 05:29 UTC](https://discourse.nodered.org/t/using-grunt-when-contributing/25519/6 "2020-05-01T05:29:28Z")

</div>

> [@BartButenaers](#):
>
> But when I explicit change my code to a nasty format, don't see an error or warning somewhere

Damn, now I know why I was so convinced that I had done this before. The Node-RED _ **dashboard** _ readme page also has a [Developer](https://github.com/node-red/node-red-dashboard#developers) section, where I had to do this (long time ago):

> We also have suggested _lint_ and _js_ styles that can be checked with:
> 
> ```auto
> gulp lint
> gulp jscs
> 
> ```

So it was in the dashboard project and not in Node-RED itself...  
Case closed !!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 June 2020 05:43 UTC](https://discourse.nodered.org/t/using-grunt-when-contributing/25519/7 "2020-06-30T05:43:18Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
