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

fix linting issues and added yml #288

Open
wants to merge 4 commits into
base: v2.x/staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html

SPDX-License-Identifier: EPL-2.0

Copyright Contributors to the Zowe Project.
*/

module.exports = {
env: {
browser: true,
es6: true,
node: true
},
ignorePatterns: ['.github/**/*.yml', '**/.build', '**/build', '**/dist', '**/node_modules', '**/release'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript'
],
parser: '@typescript-eslint/parser',
plugins: ['header'],
rules: {
'import/no-unresolved': 'off',
'@typescript-eslint/no-var-requires': 'off',
'header/header': [
2,
'block',
[
'\n This program and the accompanying materials are' +
'\n made available under the terms of the Eclipse Public License v2.0 which accompanies' +
'\n this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html' +
'\n \n SPDX-License-Identifier: EPL-2.0\n \n Copyright Contributors to the Zowe Project.\n'
],
2,
],
},
}
26 changes: 26 additions & 0 deletions .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint TypeScript

on:
push:
branches:
- v2.x/staging
pull_request:
types: [opened, reopened, synchronize]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install Dependencies
run: npm ci

- name: Lint TypeScript
run: npm run lint
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
All notable changes to the Zlux App Server package will be documented in this file.

## v2.12.0
- enhancement: added test-linter.yml to catch all linting issues whenever PR is open and fixed all existing linting issues.
- enhancement: new versions of components can change the location of their plugins, as the app-server will now re-inspect the plugin locations on each startup. (#280)
- bugfix: Removed error message "components/app-server/bin/configure.sh 26: .: FSUM6807 expression syntax error" seen in startup of Zowe in v2.11.0, caused by incorrect shell syntax. (#283)

Expand Down
6 changes: 3 additions & 3 deletions bin/init/plugins-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html

SPDX-License-Identifier: EPL-2.0

Copyright Contributors to the Zowe Project.
*/

import * as os from 'os';
import * as zos from 'zos';
// import * as zos from 'zos';
import * as std from 'std';
import * as xplatform from 'xplatform';
import * as fs from '../../../../../../bin/libs/fs';
Expand Down
14 changes: 7 additions & 7 deletions lib/initInstance.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html

SPDX-License-Identifier: EPL-2.0

Copyright Contributors to the Zowe Project.
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.
*/

const fs = require('fs');
Expand Down
14 changes: 7 additions & 7 deletions lib/initUtils.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html

SPDX-License-Identifier: EPL-2.0

Copyright Contributors to the Zowe Project.
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.
*/

const fs = require('fs');
Expand Down
21 changes: 14 additions & 7 deletions lib/upgradeInstance.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html

SPDX-License-Identifier: EPL-2.0

Copyright Contributors to the Zowe Project.
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.
*/

const fs = require('fs');
const path = require('path');
const semver = require('semver');
Expand Down Expand Up @@ -142,10 +143,13 @@ const versions = [
const pluginPath = path.join(toLocation, 'plugins', file);
const pluginJson = JSON.parse(fs.readFileSync(pluginPath, 'utf8'));
let index, componentIndex, componentsIndex, relativeIndex;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
index = componentsIndex = pluginJson.pluginLocation.indexOf('components/app-server');
if (index == -1) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
index = relativeIndex = pluginJson.pluginLocation.startsWith('../../') ? 6 : -1;
if (index == -1 && isContainer) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
index = componentIndex = pluginJson.pluginLocation.startsWith('/component/share/') ? 17 : -1;
}
}
Expand Down Expand Up @@ -177,6 +181,7 @@ const versions = [
},
{
v: '1.21.0',
// eslint-disable-next-line @typescript-eslint/no-unused-vars
upgrade: function(toLocation, serverConfig, envConfig, instanceItems) {
if (serverConfig.agent && !serverConfig.agent.mediationLayer) {
serverConfig.agent.mediationLayer = {
Expand Down Expand Up @@ -235,8 +240,10 @@ module.exports.doUpgrade = function doUpgrade(fromVersion, toLocation, serverCon
console.log('app-server config upgraded to version='+upgradedTo);
}
if (configNeedsUpdate) {
// eslint-disable-next-line no-unsafe-finally
return {upgradedTo, serverConfig};
} else {
// eslint-disable-next-line no-unsafe-finally
return {upgradedTo};
}
}
Expand Down
11 changes: 5 additions & 6 deletions lib/zluxArgs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
Expand All @@ -11,12 +9,12 @@
*/

'use strict';
const ProxyServer = require('zlux-server-framework');
// const ProxyServer = require('zlux-server-framework');
const argParser = require('zlux-server-framework/utils/argumentParser');
const jsonUtils = require('zlux-server-framework/lib/jsonUtils');
// const jsonUtils = require('zlux-server-framework/lib/jsonUtils');
const mergeUtils = require('zlux-server-framework/utils/mergeUtils');
const yamlConfig = require('zlux-server-framework/utils/yamlConfig');
const mkdirp = require('mkdirp');
// const mkdirp = require('mkdirp');
const cluster = require('cluster');

const MVD_ARGS = [
Expand Down Expand Up @@ -54,7 +52,8 @@ function getSafeToPrintEnvironment(env) {
//Env overrides config JSON, -D args override env
if(process.env.overrideFileConfig !== "false"){
if (cluster.isMaster) {
const safeEnvironment = getSafeToPrintEnvironment(process.env);
// const safeEnvironment =
getSafeToPrintEnvironment(process.env);
console.log('\nZWED5014I - Processing CLI arguments:\n'+commandArgs);
}
const envConfig = argParser.environmentVarsToObject("ZWED_");
Expand Down
2 changes: 1 addition & 1 deletion lib/zluxCluster.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
Expand All @@ -8,6 +7,7 @@

Copyright Contributors to the Zowe Project.
*/

'use strict';

const clusterManager = require('zlux-server-framework/lib/clusterManager').clusterManager;
Expand Down
2 changes: 0 additions & 2 deletions lib/zluxServer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
Expand Down
Loading
Loading