From de281abf87bb3a39ed46215acf540e53445c73d2 Mon Sep 17 00:00:00 2001 From: W Chan Date: Tue, 4 Jun 2019 22:04:31 +0000 Subject: [PATCH 1/5] Update copyright and license in README Update the copyright and license section in README. --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index edff35f..5fbf35a 100644 --- a/README.md +++ b/README.md @@ -132,12 +132,12 @@ This will bump the version in `package.json`, commit and create a tag with forma ## Copyright, License, and Contributors Agreement -Copyright 2015 StackStorm, Inc. +Copyright 2015-2019 Extreme Networks, Inc. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except -in compliance with the License. You may obtain a copy of the License in the [LICENSE](LICENSE) -file, or at: [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0). +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the [LICENSE](LICENSE) file, or at: -By contributing you agree that these contributions are your own (or approved by your employer) and -you grant a full, complete, irrevocable copyright license to all users and developers of the -project, present and future, pursuant to the license of the project. +[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +By contributing you agree that these contributions are your own (or approved by your employer) and you grant a full, complete, irrevocable copyright license to all users and developers of the project, present and future, pursuant to the license of the project. From eacb4dbaa39b117382d78e4db88535d7d8b938b2 Mon Sep 17 00:00:00 2001 From: W Chan Date: Tue, 4 Jun 2019 22:48:51 +0000 Subject: [PATCH 2/5] Rename LICENSE.txt to LICENSE To be consistent with other repos, rename the file LICENSE.txt to LICENSE. --- LICENSE.txt => LICENSE | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE.txt => LICENSE (100%) diff --git a/LICENSE.txt b/LICENSE similarity index 100% rename from LICENSE.txt rename to LICENSE From c777db5fae6eaa8d622a6223957fa367f09d88c2 Mon Sep 17 00:00:00 2001 From: W Chan Date: Wed, 5 Jun 2019 02:28:36 +0000 Subject: [PATCH 3/5] Replace jshint with eslint for linting Replace jshint with eslint for linting to be consistent with st2web and st2flow. This also allows the eslint plugins for copyright and license headers to be reused. --- .eslintignore | 1 + .eslintrc.yml | 20 ++++++++++++++++++ .gitignore | 1 + gulpfile.js | 58 +++++++++++++++++++++------------------------------ jshint.json | 16 -------------- package.json | 11 ++++++---- settings.json | 9 ++++++++ 7 files changed, 62 insertions(+), 54 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.yml delete mode 100644 jshint.json create mode 100644 settings.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..58b6715 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,20 @@ +--- +root: true +plugins: + - notice +parser: babel-eslint +parserOptions: + ecmaVersion: 6 + sourceType: module + ecmaFeatures: + jsx: true + legacyDecorators: true +env: + node: true + mocha: true + browser: true + es6: true +rules: + notice/notice: + - error + - mustMatch: "(// Copyright \\d{4} [a-zA-Z0-9,\\.\\s]+\\n)+//\\n// Licensed under the Apache License, Version 2\\.0 \\(the \"License\"\\);\\n// you may not use this file except in compliance with the License\\.\\n// You may obtain a copy of the License at\\n//\\n//\\s+http://www\\.apache\\.org/licenses/LICENSE-2\\.0\\n//\\n// Unless required by applicable law or agreed to in writing, software\\n// distributed under the License is distributed on an \"AS IS\" BASIS,\\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n// See the License for the specific language governing permissions and\\n// limitations under the License\\.\\n" diff --git a/.gitignore b/.gitignore index 4b173c6..97e8260 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ coverage/ npm-debug.log +package-lock.json diff --git a/gulpfile.js b/gulpfile.js index bfc1831..e8473e7 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,41 +1,31 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. 'use strict'; -var gulp = require('gulp'), - jshint = require('gulp-jshint'), - plumber = require('gulp-plumber'), - mocha = require('gulp-mocha'); +const gulp = require('gulp'); +const settings = require('./settings.json'); +const plugins = require('gulp-load-plugins')(settings.plugins); -gulp.task('lint', function () { - return gulp.src(['scripts/**/*.js', 'lib/**/*.js', 'tests/**/*.js']) - .pipe(plumber()) - .pipe(jshint('jshint.json')) - .pipe(jshint.reporter('jshint-stylish')); -}); +gulp.task('lint', () => gulp.src(settings.lint, { cwd: settings.dev }) + .pipe(plugins.plumber()) + .pipe(plugins.eslint()) + .pipe(plugins.eslint.format()) +); -gulp.task('test', function () { - return gulp.src('tests/**/*.js', { - read: false - }) - .pipe(mocha({ - reporter: 'spec' - })); -}); +gulp.task('test', () => gulp.src('tests/**/*.js', { read: false }) + .pipe(plugins.mocha({ reporter: 'spec' })) +); gulp.task('default', ['lint', 'test']); diff --git a/jshint.json b/jshint.json deleted file mode 100644 index 95e7c58..0000000 --- a/jshint.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "maxerr" : 100, - "node" : true, - "curly" : true, - "eqeqeq" : true, - "latedef" : false, - "undef" : true, - "newcap" : true, - "nonew" : true, - "onevar" : false, - "trailing" : true, - "white" : false, - "sub" : true, - "evil" : true, - "onecase" : true -} diff --git a/package.json b/package.json index fb37a01..38343cd 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "url": "https://github.com/StackStorm/hubot-stackstorm/issues" }, "dependencies": { + "babel-eslint": "^10.0.1", "cli-table": "<=1.0.0", "coffee-register": "1.0.0", "coffee-script": "1.12.7", @@ -36,15 +37,16 @@ "devDependencies": { "chai": "^4.2.0", "chai-as-promised": "^7.1.1", - "gulp": "^3.9.0", - "gulp-jshint": "^2.1.0", + "eslint": "^5.16.0", + "eslint-plugin-notice": "0.7.8", + "gulp": "^3.9.1", + "gulp-load-plugins": "1.5.0", + "gulp-eslint": "^5.0.0", "gulp-mocha": "^6.0.0", "gulp-plumber": "^1.2.0", "hubot": "^3.1.1", "hubot-help": "0.2.2", "hubot-mock-adapter": "^1.1.1", - "jshint": "^2.7.0", - "jshint-stylish": "^2.0.0", "log": "1.4.0", "nock": "^10.0.0", "nyc": "^13.0.1", @@ -53,6 +55,7 @@ }, "main": "index.js", "scripts": { + "eslint": "eslint .", "test": "node_modules/.bin/nyc mocha \"tests/**/*.js\"" }, "nyc": { diff --git a/settings.json b/settings.json new file mode 100644 index 0000000..daeb98a --- /dev/null +++ b/settings.json @@ -0,0 +1,9 @@ +{ + "dev": ".", + "lint": [ + "*.js", + "scripts/**/*.js", + "lib/**/*.js", + "tests/**/*.js" + ] +} From 5264f4434f2f7b5d63abde3849014adc128c96bb Mon Sep 17 00:00:00 2001 From: W Chan Date: Wed, 5 Jun 2019 02:29:35 +0000 Subject: [PATCH 4/5] Add copyright and update license headers to js files Add copyright and update Apache 2.0 license headers to all js files. --- index.js | 29 +++++++++++++---------------- lib/command_factory.js | 29 +++++++++++++---------------- lib/format_command.js | 29 +++++++++++++---------------- lib/format_data.js | 29 +++++++++++++---------------- lib/post_data.js | 29 +++++++++++++---------------- lib/slack-messages.js | 30 ++++++++++++++---------------- lib/slack_monkey_patch.js | 29 +++++++++++++---------------- lib/utils.js | 29 +++++++++++++---------------- scripts/stackstorm.js | 11 +++++------ tests/dummy-adapters.js | 30 +++++++++++++----------------- tests/dummy-robot.js | 29 +++++++++++++---------------- tests/test-command-factory.js | 29 +++++++++++++---------------- tests/test-formatcommand.js | 29 +++++++++++++---------------- tests/test-formatdata.js | 29 +++++++++++++---------------- tests/test-postdata.js | 29 +++++++++++++---------------- tests/test-slack-messages.js | 29 +++++++++++++---------------- tests/test-st2bot-setup.js | 29 +++++++++++++---------------- tests/test-twofactor.js | 29 +++++++++++++---------------- tests/test-utils.js | 29 +++++++++++++---------------- 19 files changed, 240 insertions(+), 295 deletions(-) diff --git a/index.js b/index.js index 19b2d29..d41008a 100644 --- a/index.js +++ b/index.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. var fs = require('fs'); var path = require('path'); diff --git a/lib/command_factory.js b/lib/command_factory.js index 1466adc..5f919ec 100644 --- a/lib/command_factory.js +++ b/lib/command_factory.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. "use strict"; diff --git a/lib/format_command.js b/lib/format_command.js index ff8fd92..867c09d 100644 --- a/lib/format_command.js +++ b/lib/format_command.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. "use strict"; diff --git a/lib/format_data.js b/lib/format_data.js index b4cde6f..1090ead 100644 --- a/lib/format_data.js +++ b/lib/format_data.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. "use strict"; diff --git a/lib/post_data.js b/lib/post_data.js index 61dc900..7b6e4ea 100644 --- a/lib/post_data.js +++ b/lib/post_data.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. "use strict"; diff --git a/lib/slack-messages.js b/lib/slack-messages.js index 84cea95..1e601d6 100644 --- a/lib/slack-messages.js +++ b/lib/slack-messages.js @@ -1,19 +1,17 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + "use strict"; var utils = require('./utils.js'); diff --git a/lib/slack_monkey_patch.js b/lib/slack_monkey_patch.js index 360bf5d..0547349 100644 --- a/lib/slack_monkey_patch.js +++ b/lib/slack_monkey_patch.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. function sendMessageRaw(message) { /*jshint validthis:true */ diff --git a/lib/utils.js b/lib/utils.js index 12f75bf..0f7f0f5 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. var url = require('url'), util = require('util'), diff --git a/scripts/stackstorm.js b/scripts/stackstorm.js index 43b7ce5..bb3a487 100644 --- a/scripts/stackstorm.js +++ b/scripts/stackstorm.js @@ -1,9 +1,8 @@ -// Licensed to the StackStorm, Inc ('StackStorm') under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // diff --git a/tests/dummy-adapters.js b/tests/dummy-adapters.js index 73aa651..d6d1ea5 100644 --- a/tests/dummy-adapters.js +++ b/tests/dummy-adapters.js @@ -1,20 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ - +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. "use strict"; diff --git a/tests/dummy-robot.js b/tests/dummy-robot.js index 7c1f3bb..6ea8a2a 100644 --- a/tests/dummy-robot.js +++ b/tests/dummy-robot.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. "use strict"; diff --git a/tests/test-command-factory.js b/tests/test-command-factory.js index d343b82..ea3b629 100644 --- a/tests/test-command-factory.js +++ b/tests/test-command-factory.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /*jshint quotmark:false*/ /*global describe, it*/ diff --git a/tests/test-formatcommand.js b/tests/test-formatcommand.js index a12ccf8..be10213 100644 --- a/tests/test-formatcommand.js +++ b/tests/test-formatcommand.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /*jshint quotmark:false*/ /*global describe, it*/ diff --git a/tests/test-formatdata.js b/tests/test-formatdata.js index 833952b..d373c76 100644 --- a/tests/test-formatdata.js +++ b/tests/test-formatdata.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /*jshint quotmark:false*/ /*global describe, it*/ diff --git a/tests/test-postdata.js b/tests/test-postdata.js index a6d6353..a275017 100644 --- a/tests/test-postdata.js +++ b/tests/test-postdata.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /*jshint quotmark:false*/ /*jshint -W030*/ diff --git a/tests/test-slack-messages.js b/tests/test-slack-messages.js index e7741fc..dd5d076 100644 --- a/tests/test-slack-messages.js +++ b/tests/test-slack-messages.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /*jshint quotmark:false*/ /*global describe, it*/ diff --git a/tests/test-st2bot-setup.js b/tests/test-st2bot-setup.js index a3f8e96..47595be 100644 --- a/tests/test-st2bot-setup.js +++ b/tests/test-st2bot-setup.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /*jshint quotmark:false*/ /*jshint -W030*/ diff --git a/tests/test-twofactor.js b/tests/test-twofactor.js index 40d0f05..94785a7 100644 --- a/tests/test-twofactor.js +++ b/tests/test-twofactor.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /*jshint quotmark:false*/ /*jshint -W030*/ diff --git a/tests/test-utils.js b/tests/test-utils.js index 3a5a9a8..e858f6d 100644 --- a/tests/test-utils.js +++ b/tests/test-utils.js @@ -1,19 +1,16 @@ -/* - Licensed to the StackStorm, Inc ('StackStorm') under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ +// Copyright 2019 Extreme Networks, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /*jshint quotmark:false*/ /*global describe, it*/ From 4d44659f1fef15a9c236757ac3658853ab8eeaf4 Mon Sep 17 00:00:00 2001 From: W Chan Date: Wed, 5 Jun 2019 02:44:36 +0000 Subject: [PATCH 5/5] Add baseline eslint rules Add eslint rules from st2web that hubot-stackstorm already complies with. For rules that failed, they will be evaluated and included here separately. --- .eslintrc.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.eslintrc.yml b/.eslintrc.yml index 58b6715..7805856 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -15,6 +15,46 @@ env: browser: true es6: true rules: + camelcase: off + curly: + - error + - all + eqeqeq: + - error + - allow-null + strict: off + new-cap: error + no-bitwise: error + no-caller: error + no-case-declarations: off + no-cond-assign: + - error + - except-parens + no-debugger: error + no-empty: error + no-eval: error + no-extend-native: error + no-irregular-whitespace: error + no-iterator: error + no-loop-func: error + no-multi-str: error + no-new: error + no-proto: error + no-script-url: error + no-sequences: error + no-undef: error + no-with: error + valid-typeof: error + wrap-iife: + - error + - inside + + arrow-spacing: error + prefer-const: error + prefer-spread: error + rest-spread-spacing: error + template-curly-spacing: error + notice/notice: - error - mustMatch: "(// Copyright \\d{4} [a-zA-Z0-9,\\.\\s]+\\n)+//\\n// Licensed under the Apache License, Version 2\\.0 \\(the \"License\"\\);\\n// you may not use this file except in compliance with the License\\.\\n// You may obtain a copy of the License at\\n//\\n//\\s+http://www\\.apache\\.org/licenses/LICENSE-2\\.0\\n//\\n// Unless required by applicable law or agreed to in writing, software\\n// distributed under the License is distributed on an \"AS IS\" BASIS,\\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n// See the License for the specific language governing permissions and\\n// limitations under the License\\.\\n"