Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed May 6, 2024
1 parent 154b4bd commit 610ba88
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 24 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ jobs:
run: redrun lint
- name: Build
id: build
run: >
run: |
redrun build
echo "::set-output name=version::$(grep '"version":' package.json -m1
| cut -d\" -f4)"
echo "::set-output name=version::$(grep '"version":' package.json -m1 | cut -d\" -f4)"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand Down
15 changes: 8 additions & 7 deletions client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ function CloudCmdProto(DOM) {
right: 'asc',
};

this.changeDir = async (path, {
isRefresh,
panel,
history = true,
noCurrent,
currentName,
} = {}) => {
this.changeDir = async (path, overrides = {}) => {
const {
isRefresh,
panel,
history = true,
noCurrent,
currentName,
} = overrides;
const refresh = isRefresh;
let panelChanged;

Expand Down
20 changes: 11 additions & 9 deletions client/dom/current-file.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,17 @@ test('current-file: parseHrefAttribute', (t) => {
t.end();
});

function getDOM({
link = {},
getCurrentDirPath = stub(),
getCurrentDirName = stub(),
getByDataName = stub(),
isContainClass = stub(),
getCurrentType = stub(),
getCurrentPath = stub(),
} = {}) {
function getDOM(overrides = {}) {
const {
link = {},
getCurrentDirPath = stub(),
getCurrentDirName = stub(),
getByDataName = stub(),
isContainClass = stub(),
getCurrentType = stub(),
getCurrentPath = stub(),
} = overrides;

return {
getCurrentDirPath,
getCurrentDirName,
Expand Down
6 changes: 5 additions & 1 deletion server/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ function _getModule(a) {
return require(a);
}

module.exports = (config, arg, {getModule = _getModule} = {}) => {
module.exports = (config, arg, overrides = {}) => {
const {
getModule = _getModule,
} = overrides;

if (!config('terminal'))
return noop;

Expand Down
19 changes: 16 additions & 3 deletions server/validate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import {getThemes as _getThemes} from './theme.mjs';

const isString = (a) => typeof a === 'string';

export const root = (dir, config, {exit = _exit, statSync = _statSync} = {}) => {
export const root = (dir, config, overrides = {}) => {
const {
exit = _exit,
statSync = _statSync,
} = overrides;

if (!isString(dir))
throw Error('dir should be a string');

Expand Down Expand Up @@ -36,7 +41,11 @@ export const packer = (name, {exit = _exit} = {}) => {
exit('cloudcmd --packer: could be "tar" or "zip" only');
};

export const columns = (type, {exit = _exit, getColumns = _getColumns} = {}) => {
export const columns = (type, overrides = {}) => {
const {
exit = _exit,
getColumns = _getColumns,
} = overrides;
const addQuotes = (a) => `"${a}"`;
const all = Object
.keys(getColumns())
Expand All @@ -51,7 +60,11 @@ export const columns = (type, {exit = _exit, getColumns = _getColumns} = {}) =>
exit(`cloudcmd --columns: can be only one of: ${names}`);
};

export const theme = (type, {exit = _exit, getThemes = _getThemes} = {}) => {
export const theme = (type, overrides = {}) => {
const {
exit = _exit,
getThemes = _getThemes,
} = overrides;
const addQuotes = (a) => `"${a}"`;
const all = Object
.keys(getThemes())
Expand Down

0 comments on commit 610ba88

Please sign in to comment.