From 0a045aa93a9cfb6baa8c22cbcc79a85045dfe701 Mon Sep 17 00:00:00 2001 From: sonal-chauhan Date: Wed, 17 May 2023 16:38:00 +0530 Subject: [PATCH] fixing for private run --- testdata/num_guess.py | 43 ----------------------------- testdata/subfolder/queen_problem.py | 40 --------------------------- testdata/syntax_error.py | 1 - 3 files changed, 84 deletions(-) delete mode 100644 testdata/num_guess.py delete mode 100644 testdata/subfolder/queen_problem.py delete mode 100644 testdata/syntax_error.py diff --git a/testdata/num_guess.py b/testdata/num_guess.py deleted file mode 100644 index c190326..0000000 --- a/testdata/num_guess.py +++ /dev/null @@ -1,43 +0,0 @@ -"""Small test script taken from https://wiki.python.org/moin/SimplePrograms""" - -import random -import sys # F401 'os' imported but unused -import os # F401 'os' imported but unused - -### E265 block comment should start with '# ' -print("Hello from reviewdog!") -print("Let's play a small number guessing game to test the flake8 github action.") -print("This game is taken from https://wiki.python.org/moin/SimplePrograms.") - -guesses_made = 0 - -name = input("Hello! What is your name?\n") - -number = random.randint(1, 20) -print("Well, {0}, I am thinking of a number between 1 and 20.".format(name)) # E501 line too long (80 > 79 characters) - -while guesses_made < 6: - - guess = int(input("Take a guess: ")) - - guesses_made += 1 - - if guess < number: - print("Your guess is too low.") - - if guess > number: - print("Your guess is too high.") - - if guess == number: - break - -if guess == number: - print( - "Good job, {0}! You guessed my number in {1} guesses!".format( - name, guesses_made - ) - ) -else: - print("Nope. The number I was thinking of was {0}".format(number)) - -import itertools # E402 module level import not at top of file \ No newline at end of file diff --git a/testdata/subfolder/queen_problem.py b/testdata/subfolder/queen_problem.py deleted file mode 100644 index 210bb78..0000000 --- a/testdata/subfolder/queen_problem.py +++ /dev/null @@ -1,40 +0,0 @@ -"""Small test script taken from https://wiki.python.org/moin/SimplePrograms""" - -import pwd # F401 'os' imported but unused -import grp # F401 'os' imported but unused - -BOARD_SIZE = 8 - -### E265 block comment should start with '# ' -print("Hello from reviewdog!") -print("Let's play a small queen problem game to test the flake8 github action.") -print("This game is taken from https://wiki.python.org/moin/SimplePrograms.") - -class BailOut(Exception): - pass - -def validate(queens): - left = right = col = queens[-1] # E501 line too long (80 > 79 characters). Long description text - for r in reversed(queens[:-1]): - left, right = left-1, right+1 - if r in (left, col, right): - raise BailOut - -def add_queen(queens): - for i in range(BOARD_SIZE): - test_queens = queens + [i] - try: - validate(test_queens) - if len(test_queens) == BOARD_SIZE: - return test_queens - else: - return add_queen(test_queens) - except BailOut: - pass - raise BailOut - -queens = add_queen([]) -print (queens) -print ("\n".join(". "*q + "Q " + ". "*(BOARD_SIZE-q-1) for q in queens)) - -import dis # E402 module level import not at top of file \ No newline at end of file diff --git a/testdata/syntax_error.py b/testdata/syntax_error.py deleted file mode 100644 index 9ec9259..0000000 --- a/testdata/syntax_error.py +++ /dev/null @@ -1 +0,0 @@ -jan~03 \ No newline at end of file