Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
asaldele1 committed Jan 10, 2024
1 parent 112382f commit a0b1744
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
13 changes: 11 additions & 2 deletions src/companion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import os from 'os';
const emptyResponse: CphEmptyResponse = { empty: true };
let savedResponse: CphEmptyResponse | CphSubmitResponse = emptyResponse;
const COMPANION_LOGGING = false;
export let stepikResult = "";
export let stepikResult = '';

export const submitKattisProblem = (problem: Problem) => {
globalThis.reporter.sendTelemetryEvent(telmetry.SUBMIT_TO_KATTIS);
Expand Down Expand Up @@ -106,7 +106,16 @@ export const submitStepikProblem = (problem: Problem) => {
submitPath = `${homedir}/.stepik/submitter.py`;
}
}
const pyshell = spawn('python', [submitPath, 'submit', srcPath, '-l', getLanguageIdStepik(problem.srcPath), '--link', problem.url, "--silent"]);
const pyshell = spawn('python', [
submitPath,
'submit',
srcPath,
'-l',
getLanguageIdStepik(problem.srcPath),
'--link',
problem.url,
'--silent',
]);

pyshell.stdout.on('data', function (data) {
console.log(data.toString());
Expand Down
14 changes: 9 additions & 5 deletions src/preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ export const getLanguageIdStepik = (srcPath: string): string => {
}

case '.py': {
compiler = getPreference('language.python.SubmissionCompilerStepik');
compiler = getPreference(
'language.python.SubmissionCompilerStepik',
);
break;
}

Expand All @@ -205,10 +207,12 @@ export const getLanguageIdStepik = (srcPath: string): string => {
}

case '.hs': {
compiler = getPreference('language.haskell.SubmissionCompilerStepik');
compiler = getPreference(
'language.haskell.SubmissionCompilerStepik',
);
break;
}
}
if (compiler == null) return "";
return compiler
};
if (compiler == null) return '';
return compiler;
};
6 changes: 5 additions & 1 deletion src/submit.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { getProblem } from './parser';
import * as vscode from 'vscode';
import { storeSubmitProblem, submitKattisProblem, submitStepikProblem } from './companion';
import {
storeSubmitProblem,
submitKattisProblem,
submitStepikProblem,
} from './companion';
import { getJudgeViewProvider } from './extension';
import telmetry from './telmetry';

Expand Down
6 changes: 5 additions & 1 deletion src/webview/JudgeView.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import * as vscode from 'vscode';
import { storeSubmitProblem, submitKattisProblem, submitStepikProblem } from '../companion';
import {
storeSubmitProblem,
submitKattisProblem,
submitStepikProblem,
} from '../companion';
import { killRunning } from '../executions';
import { saveProblem } from '../parser';
import { VSToWebViewMessage, WebviewToVSEvent } from '../types';
Expand Down
4 changes: 2 additions & 2 deletions src/webview/frontend/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
RunningCommand,
WebViewpersistenceState,
} from '../../types';
import { stepikResult } from '../../companion'
import { stepikResult } from '../../companion';
import CaseView from './CaseView';
declare const vscodeApi: {
postMessage: (message: WebviewToVSEvent) => void;
Expand Down Expand Up @@ -357,7 +357,7 @@ function Judge(props: {
)}
</div>
);
}else if (url.hostname == 'stepik.org') {
} else if (url.hostname == 'stepik.org') {
return (
<div className="pad-10 submit-area">
<button className="btn" onClick={submitStepik}>
Expand Down

0 comments on commit a0b1744

Please sign in to comment.