node-red / nrlint

Node-RED Flow Linter
Apache License 2.0
36 stars 15 forks source link

Dummy Names for Functions and Links clashes nrLint Check #30

Open ba47-development opened 2 years ago

ba47-development commented 2 years ago

Current Behavior

As discussed in https://discourse.nodered.org/t/node-red-3-0-0-beta-2-released/62698/28, so that this doesn't get missed. Also see https://github.com/node-red/node-red/issues/3618.

nrLint rules 'no-unnamed-functions' and 'no-unnamed-links' do not work with NR 3.0 automatic node naming.

Even if nodes now get dummy names, these are still considered to be unnamed, because "function 1" is as meaningless as "function".

Expected Behavior

No response

Steps To Reproduce

No response

Example flow

No response

Environment

No response

knolleary commented 2 years ago

nrLint rules 'no-unnamed-functions' and 'no-unnamed-links' do not work with NR 3.0 automatic node naming.

Yes it does - it identifies the nodes that have a blank name which is all they say they do.

Even if nodes now get dummy names, these are still considered to be unnamed, because "function 1" is as meaningless as "function".

To be clear - as I said on the forum - having a name of function 1 is not as meaningless as having a blank name (which then shows as function in the workspace). If you have 10 function nodes, all with blank names, then you have 10 nodes you cannot quickly distinguish. That is markedly different to having function 1, function 2 etc - where you can at least quickly distinguish them when looking in the logs etc.

I fully agree it would be better for the user to set meaningful names - but the purpose of the generated default name is to help those users who don't rename things.

The resolution for this issue will be either:

ba47-development commented 2 years ago

I fully agree it would be better for the user to set meaningful names - but the purpose of the generated default name is to help those users who don't rename things.

Thank you. :-)

The resolution for this issue will be either:

  • add a 'no-default-named-functions/links` rules that specifically looks for nodes with the generate names
  • add an option to the existing rules to also consider the generated names

I personally don't mind as long as we get that function.

ba47-development commented 2 years ago

Apart from that. :-) Any idea when the new version of nrLint will be published?