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

Linting: trailing whitespace #74

Merged
merged 1 commit into from
Aug 16, 2017

Conversation

Nathan-Schwartz
Copy link
Member

This PR adds adds a linting rule that warns when there is trailing whitespace.

Running yarn lint:fix will fix all occurrences.

I do realize this is a personal preference, let me know if you'd prefer to leave it as-is 🙂

@coveralls
Copy link

coveralls commented Aug 13, 2017

Coverage Status

Coverage remained the same at 99.483% when pulling ec8212a on Nathan-Schwartz:trailing-whitespace into f453688 on ice-services:master.

@benchmark-bot
Copy link

🏁 Benchmark results

📝 Moleculer common benchmarks

⚡ Suite: Local call

Test Master PR Diff %
broker.call (normal) 545,004 607,384 +62,380 Performance: +11%
broker.call (with params) 588,515 583,060 -5,455 Performance: -1%

⚡ Suite: Call with middlewares

Test Master PR Diff %
No middlewares 566,405 618,966 +52,562 Performance: +9%
5 middlewares 564,802 631,089 +66,287 Performance: +12%

⚡ Suite: Call with statistics & metrics

Test Master PR Diff %
No statistics 619,737 617,202 -2,535 Performance: 0%
With metrics 86,149 86,151 +2 Performance: +0%
With statistics 116,508 149,019 +32,511 Performance: +28%
With metrics & statistics 63,942 59,672 -4,271 Performance: -7%

⚡ Suite: Remote call with FakeTransporter

Test Master PR Diff %
Remote call echo.reply 14,478 12,753 -1,725 Performance: -12%
Master detailed results
{
  "name": "Moleculer common benchmarks",
  "suites": [
    {
      "name": "Local call",
      "tests": [
        {
          "name": "broker.call (normal)",
          "reference": true,
          "stat": {
            "duration": 5.001794219,
            "cycle": 0,
            "count": 2726000,
            "avg": 0.0000018348474757887013,
            "rps": 545004.428539846,
            "percent": 0
          }
        },
        {
          "name": "broker.call (with params)",
          "fastest": true,
          "stat": {
            "duration": 5.000721424,
            "cycle": 0,
            "count": 2943000,
            "avg": 0.0000016991917852531431,
            "rps": 588515.0862184879,
            "percent": 7.983542041156255
          }
        }
      ]
    },
    {
      "name": "Call with middlewares",
      "tests": [
        {
          "name": "No middlewares",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 4.999958303,
            "cycle": 0,
            "count": 2832000,
            "avg": 0.0000017655219996468926,
            "rps": 566404.723475551,
            "percent": 0
          }
        },
        {
          "name": "5 middlewares",
          "stat": {
            "duration": 4.999979841,
            "cycle": 0,
            "count": 2824000,
            "avg": 0.0000017705311051699717,
            "rps": 564802.2771698211,
            "percent": -0.2829154206019098
          }
        }
      ]
    },
    {
      "name": "Call with statistics & metrics",
      "tests": [
        {
          "name": "No statistics",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.000504963,
            "cycle": 0,
            "count": 3099000,
            "avg": 0.0000016135866289125525,
            "rps": 619737.411107535,
            "percent": 0
          }
        },
        {
          "name": "With metrics",
          "stat": {
            "duration": 5.002984364,
            "cycle": 0,
            "count": 431000,
            "avg": 0.000011607852352668212,
            "rps": 86148.58025568677,
            "percent": -86.0991802799624
          }
        },
        {
          "name": "With statistics",
          "stat": {
            "duration": 5.003934198,
            "cycle": 0,
            "count": 583000,
            "avg": 0.00000858307752658662,
            "rps": 116508.32663487396,
            "percent": -81.20037219849911
          }
        },
        {
          "name": "With metrics & statistics",
          "stat": {
            "duration": 5.160894464,
            "cycle": 0,
            "count": 330000,
            "avg": 0.000015639074133333333,
            "rps": 63942.40422894259,
            "percent": -89.68233915156569
          }
        }
      ]
    },
    {
      "name": "Remote call with FakeTransporter",
      "tests": [
        {
          "name": "Remote call echo.reply",
          "fastest": true,
          "stat": {
            "duration": 5.04201994,
            "cycle": 0,
            "count": 73000,
            "avg": 0.00006906876630136986,
            "rps": 14478.32433601998,
            "percent": 0
          }
        }
      ]
    }
  ],
  "timestamp": 1502665181550,
  "generated": "Sun Aug 13 2017 22:59:41 GMT+0000 (UTC)",
  "elapsedMs": 47028
}
  
PR detailed results
{
  "name": "Moleculer common benchmarks",
  "suites": [
    {
      "name": "Local call",
      "tests": [
        {
          "name": "broker.call (normal)",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.000130217,
            "cycle": 0,
            "count": 3037000,
            "avg": 0.000001646404417846559,
            "rps": 607384.1816508037,
            "percent": 0
          }
        },
        {
          "name": "broker.call (with params)",
          "stat": {
            "duration": 5.001203374,
            "cycle": 0,
            "count": 2916000,
            "avg": 0.0000017150903203017834,
            "rps": 583059.6722299979,
            "percent": -4.004797977236478
          }
        }
      ]
    },
    {
      "name": "Call with middlewares",
      "tests": [
        {
          "name": "No middlewares",
          "reference": true,
          "stat": {
            "duration": 5.000272021,
            "cycle": 0,
            "count": 3095000,
            "avg": 0.0000016155967757673666,
            "rps": 618966.3256322271,
            "percent": 0
          }
        },
        {
          "name": "5 middlewares",
          "fastest": true,
          "stat": {
            "duration": 4.999296452,
            "cycle": 0,
            "count": 3155000,
            "avg": 0.0000015845630592709984,
            "rps": 631088.800252648,
            "percent": 1.9585030911073602
          }
        }
      ]
    },
    {
      "name": "Call with statistics & metrics",
      "tests": [
        {
          "name": "No statistics",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.001600873,
            "cycle": 0,
            "count": 3087000,
            "avg": 0.0000016202140826044705,
            "rps": 617202.3874724719,
            "percent": 0
          }
        },
        {
          "name": "With metrics",
          "stat": {
            "duration": 5.002872741,
            "cycle": 0,
            "count": 431000,
            "avg": 0.000011607593366589327,
            "rps": 86150.50238392621,
            "percent": -86.04177428141128
          }
        },
        {
          "name": "With statistics",
          "stat": {
            "duration": 4.999349103,
            "cycle": 0,
            "count": 745000,
            "avg": 0.000006710535708724832,
            "rps": 149019.3992559835,
            "percent": -75.85566707441974
          }
        },
        {
          "name": "With metrics & statistics",
          "stat": {
            "duration": 5.010762653,
            "cycle": 0,
            "count": 299000,
            "avg": 0.00001675840352173913,
            "rps": 59671.555151586625,
            "percent": -90.331930601249
          }
        }
      ]
    },
    {
      "name": "Remote call with FakeTransporter",
      "tests": [
        {
          "name": "Remote call echo.reply",
          "fastest": true,
          "stat": {
            "duration": 5.018438488,
            "cycle": 0,
            "count": 64000,
            "avg": 0.000078413101375,
            "rps": 12752.970899819864,
            "percent": 0
          }
        }
      ]
    }
  ],
  "timestamp": 1502665280625,
  "generated": "Sun Aug 13 2017 23:01:20 GMT+0000 (UTC)",
  "elapsedMs": 46849
}
  

@WoLfulus
Copy link
Contributor

It'll be awesome to add a .editorconfig with trim_trailing_whitespace = true too. Most IDEs support .editorconfig and you won't need to keep manually fixing those.

http://editorconfig.org/

@icebob
Copy link
Member

icebob commented Aug 15, 2017

@WoLfulus It added: https://github.com/ice-services/moleculer/blob/master/.editorconfig#L6
But vscode doesn't do it at me. Any idea why?

@WoLfulus
Copy link
Contributor

@icebob you should install an extension on vscode to make it work.

@coveralls
Copy link

coveralls commented Aug 15, 2017

Coverage Status

Coverage remained the same at 99.483% when pulling b5ea90e on Nathan-Schwartz:trailing-whitespace into 9d59ed3 on ice-services:master.

@benchmark-bot
Copy link

🏁 Benchmark results

📝 Moleculer common benchmarks

⚡ Suite: Local call

Test Master PR Diff %
broker.call (normal) 548,314 651,724 +103,410 Performance: +19%
broker.call (with params) 589,468 599,118 +9,650 Performance: +2%

⚡ Suite: Call with middlewares

Test Master PR Diff %
No middlewares 583,188 634,767 +51,579 Performance: +9%
5 middlewares 613,493 613,143 -350 Performance: 0%

⚡ Suite: Call with statistics & metrics

Test Master PR Diff %
No statistics 632,832 625,490 -7,342 Performance: -1%
With metrics 95,562 95,112 -449 Performance: 0%
With statistics 116,017 135,951 +19,934 Performance: +17%
With metrics & statistics 63,356 46,835 -16,522 Performance: -26%

⚡ Suite: Remote call with FakeTransporter

Test Master PR Diff %
Remote call echo.reply 14,312 12,883 -1,428 Performance: -10%
Master detailed results
{
  "name": "Moleculer common benchmarks",
  "suites": [
    {
      "name": "Local call",
      "tests": [
        {
          "name": "broker.call (normal)",
          "reference": true,
          "stat": {
            "duration": 5.000784663,
            "cycle": 0,
            "count": 2742000,
            "avg": 0.000001823772670678337,
            "rps": 548313.9516659487,
            "percent": 0
          }
        },
        {
          "name": "broker.call (with params)",
          "fastest": true,
          "stat": {
            "duration": 4.999419735,
            "cycle": 0,
            "count": 2947000,
            "avg": 0.0000016964437512724805,
            "rps": 589468.4095773366,
            "percent": 7.5056375615371
          }
        }
      ]
    },
    {
      "name": "Call with middlewares",
      "tests": [
        {
          "name": "No middlewares",
          "reference": true,
          "stat": {
            "duration": 5.000105367,
            "cycle": 0,
            "count": 2916000,
            "avg": 0.0000017147137746913579,
            "rps": 583187.7102521068,
            "percent": 0
          }
        },
        {
          "name": "5 middlewares",
          "fastest": true,
          "stat": {
            "duration": 5.000868404,
            "cycle": 0,
            "count": 3068000,
            "avg": 0.0000016300092581486312,
            "rps": 613493.4479671622,
            "percent": 5.196566591218897
          }
        }
      ]
    },
    {
      "name": "Call with statistics & metrics",
      "tests": [
        {
          "name": "No statistics",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.00132451,
            "cycle": 0,
            "count": 3165000,
            "avg": 0.000001580197317535545,
            "rps": 632832.3614417893,
            "percent": 0
          }
        },
        {
          "name": "With metrics",
          "stat": {
            "duration": 5.00200753,
            "cycle": 0,
            "count": 478000,
            "avg": 0.00001046445089958159,
            "rps": 95561.63143161041,
            "percent": -84.89937663524488
          }
        },
        {
          "name": "With statistics",
          "stat": {
            "duration": 5.050997049,
            "cycle": 0,
            "count": 586000,
            "avg": 0.0000086194488890785,
            "rps": 116016.6981519058,
            "percent": -81.66707247910274
          }
        },
        {
          "name": "With metrics & statistics",
          "stat": {
            "duration": 5.334921272,
            "cycle": 0,
            "count": 338000,
            "avg": 0.00001578379074556213,
            "rps": 63356.13643897087,
            "percent": -89.98848031497222
          }
        }
      ]
    },
    {
      "name": "Remote call with FakeTransporter",
      "tests": [
        {
          "name": "Remote call echo.reply",
          "fastest": true,
          "stat": {
            "duration": 5.030913746,
            "cycle": 0,
            "count": 72000,
            "avg": 0.00006987380202777778,
            "rps": 14311.51548905923,
            "percent": 0
          }
        }
      ]
    }
  ],
  "timestamp": 1502834115858,
  "generated": "Tue Aug 15 2017 21:55:15 GMT+0000 (UTC)",
  "elapsedMs": 47237
}
  
PR detailed results
{
  "name": "Moleculer common benchmarks",
  "suites": [
    {
      "name": "Local call",
      "tests": [
        {
          "name": "broker.call (normal)",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.000581211,
            "cycle": 0,
            "count": 3259000,
            "avg": 0.0000015343912890457196,
            "rps": 651724.2421403002,
            "percent": 0
          }
        },
        {
          "name": "broker.call (with params)",
          "stat": {
            "duration": 5.000681896,
            "cycle": 0,
            "count": 2996000,
            "avg": 0.000001669119457943925,
            "rps": 599118.2927265327,
            "percent": -8.071811053246464
          }
        }
      ]
    },
    {
      "name": "Call with middlewares",
      "tests": [
        {
          "name": "No middlewares",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.000263266,
            "cycle": 0,
            "count": 3174000,
            "avg": 0.0000015753822514177694,
            "rps": 634766.577508441,
            "percent": 0
          }
        },
        {
          "name": "5 middlewares",
          "stat": {
            "duration": 5.00046423,
            "cycle": 0,
            "count": 3066000,
            "avg": 0.0000016309407142857144,
            "rps": 613143.0721183261,
            "percent": -3.40652866050236
          }
        }
      ]
    },
    {
      "name": "Call with statistics & metrics",
      "tests": [
        {
          "name": "No statistics",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.000879423,
            "cycle": 0,
            "count": 3128000,
            "avg": 0.000001598746618606138,
            "rps": 625489.9859440182,
            "percent": 0
          }
        },
        {
          "name": "With metrics",
          "stat": {
            "duration": 5.004610517,
            "cycle": 0,
            "count": 476000,
            "avg": 0.000010513887640756302,
            "rps": 95112.29662789761,
            "percent": -84.79395373782847
          }
        },
        {
          "name": "With statistics",
          "stat": {
            "duration": 5.00180359,
            "cycle": 0,
            "count": 680000,
            "avg": 0.000007355593514705882,
            "rps": 135950.9600415957,
            "percent": -78.26488623372407
          }
        },
        {
          "name": "With metrics & statistics",
          "stat": {
            "duration": 5.4019927039999995,
            "cycle": 0,
            "count": 253000,
            "avg": 0.000021351749818181817,
            "rps": 46834.568993894005,
            "percent": -92.51233911871361
          }
        }
      ]
    },
    {
      "name": "Remote call with FakeTransporter",
      "tests": [
        {
          "name": "Remote call echo.reply",
          "fastest": true,
          "stat": {
            "duration": 5.045367797,
            "cycle": 0,
            "count": 65000,
            "avg": 0.00007762104303076924,
            "rps": 12883.104387087362,
            "percent": 0
          }
        }
      ]
    }
  ],
  "timestamp": 1502834218446,
  "generated": "Tue Aug 15 2017 21:56:58 GMT+0000 (UTC)",
  "elapsedMs": 47273
}
  

@icebob
Copy link
Member

icebob commented Aug 16, 2017

Thanks. I will merge it after #72

@coveralls
Copy link

coveralls commented Aug 16, 2017

Coverage Status

Coverage remained the same at 99.483% when pulling e5fb14a on Nathan-Schwartz:trailing-whitespace into df0c76b on ice-services:master.

@Nathan-Schwartz
Copy link
Member Author

Updated commit to fixed conflicts

@coveralls
Copy link

coveralls commented Aug 16, 2017

Coverage Status

Coverage remained the same at 99.024% when pulling a7a1d78 on Nathan-Schwartz:trailing-whitespace into 5c58752 on ice-services:master.

@icebob icebob merged commit b7c308c into moleculerjs:master Aug 16, 2017
@icebob
Copy link
Member

icebob commented Aug 16, 2017

Thank you! Merged!

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

Successfully merging this pull request may close these issues.

5 participants