🚨 Fixed linter warnings

This commit is contained in:
Mawoka
2022-06-20 21:54:15 +02:00
parent c1c2405067
commit 4d8caa6dc7
10 changed files with 3 additions and 38 deletions
-2
View File
@@ -117,7 +117,6 @@ def check_hashcash(data: str, input_data: str) -> bool:
:type input_data: str
:return: A boolean value.
"""
print(data, input_data, hc_check(data))
if not hc_check(data):
return False
@@ -132,5 +131,4 @@ def check_hashcash(data: str, input_data: str) -> bool:
assert ext == ""
return True
except AssertionError as e:
print(e, "hilo")
return False
+1 -23
View File
@@ -1,37 +1,20 @@
<script lang="ts">
import { getLocalization } from '$lib/i18n';
import { mint } from '$lib/hashcash';
import { dataSchema } from '$lib/yupSchemas';
import type { EditorData, Question, Answer } from './quiz_types';
import type { EditorData, Question } from './quiz_types';
import Sidebar from '$lib/editor/sidebar.svelte';
import SettingsCard from '$lib/editor/settings-card.svelte';
import QuizCard from '$lib/editor/card.svelte';
import Spinner from './Spinner.svelte';
import { onMount } from 'svelte';
const { t } = getLocalization();
let schemaInvalid = false;
let yupErrorMessage = '';
export let data: EditorData;
export let submit_button_text = 'Create';
export let quiz_id: string | null;
let selected_question = -1;
let imgur_links_valid = false;
const empty_question: Question = {
question: '',
time: '20',
image: '',
answers: [
{
right: false,
answer: ''
}
]
};
const validateInput = async (data: EditorData) => {
try {
await dataSchema.validate(data, { abortEarly: false });
@@ -61,11 +44,6 @@
};
$: imgur_links_valid = checkIfAllQuestionImagesComplyWithRegex(data.questions);
const empty_answer: Answer = {
right: false,
answer: ''
};
let edit_id;
let confirm_to_leave = true;
let pow_data;
+1 -1
View File
@@ -43,7 +43,7 @@
uppy.on('upload-success', (file, response) => {
image_id = response.body.id;
});
uppy.on('complete', (res) => {
uppy.on('complete', (_) => {
console.log(pow_data);
data.questions[
selected_question
-1
View File
@@ -29,7 +29,6 @@ export const mint = async (
const zeros = '0'.repeat(hex_digits);
const salt = gen_salt(saltchars);
const challenge = `${ver}:${bits}:${ts}:${resource}:${ext}:${salt}`;
let digest: string;
let counter = 0;
let result: string;
while (true) {
+1 -1
View File
@@ -10,7 +10,7 @@ import { goto } from '$app/navigation';
import { page } from '$app/stores';
const URLSearchParamsToObject = (params: URLSearchParams) => {
let obj = {};
const obj = {};
params.forEach((v: string, k: string) => {
obj[k] = v;
});
-3
View File
@@ -20,7 +20,6 @@
import Editor from '$lib/editor.svelte';
import { getLocalization } from '$lib/i18n';
import { navbarVisible } from '$lib/stores';
import { dataSchema } from '$lib/yupSchemas';
navbarVisible.set(false);
@@ -49,7 +48,6 @@
};
let data: Data;
let confirm_to_leave = true;
let quiz_id = null;
onMount(() => {
const from_localstorage = localStorage.getItem('create_game');
@@ -130,7 +128,6 @@
<button
type="button"
on:click={() => {
confirm_to_leave = false;
window.location.href = '/overview';
}}
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
-3
View File
@@ -31,7 +31,6 @@
import Editor from '$lib/editor.svelte';
import { getLocalization } from '$lib/i18n';
import { navbarVisible } from '$lib/stores';
import { dataSchema } from '$lib/yupSchemas';
navbarVisible.set(false);
@@ -41,7 +40,6 @@
open: false,
data: ''
};
let confirm_to_leave = true;
interface Data {
public: boolean;
@@ -157,7 +155,6 @@
<button
type="button"
on:click={() => {
confirm_to_leave = false;
window.location.href = '/overview';
}}
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
-2
View File
@@ -10,8 +10,6 @@
</script>
<script lang="ts">
import { getLocalization } from '$lib/i18n';
const { t } = getLocalization();
import SearchCard from '$lib/search-card.svelte';
const getData = async () => {
const response = await fetch('/api/v1/search/', {
-1
View File
@@ -20,7 +20,6 @@
import LandingPromo from '$lib/landing/landing-promo.svelte';
import { onMount } from 'svelte';
import { mint } from '$lib/hashcash';
const { t } = getLocalization();
-1
View File
@@ -12,7 +12,6 @@
<script lang="ts">
import { getLocalization } from '$lib/i18n';
const { t } = getLocalization();
import { page } from '$app/stores';
import SearchCard from '$lib/search-card.svelte';
import { createQueryParamsStore } from '$lib/stores';
const search_term = createQueryParamsStore('q');