generated from reviewdog/action-template
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
206 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# This file doesn't need formatting, so Black should skip it\n", | ||
"print(\"hello world\")" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This file doesn't need formatting, so Black should skip it | ||
print("hello world") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"\"\"\"Small test script taken from https://wiki.python.org/moin/SimplePrograms\"\"\"\n", | ||
"\n", | ||
"import random\n", | ||
"import sys # F401 'os' imported but unused\n", | ||
"import os # F401 'os' imported but unused\n", | ||
"\n", | ||
"### E265 block comment should start with '# '\n", | ||
"print(\"Hello from reviewdog!\")\n", | ||
"print(\"Let's play a small number guessing game to test the flake8 github action.\")\n", | ||
"print(\"This game is taken from https://wiki.python.org/moin/SimplePrograms.\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"guesses_made = 0\n", | ||
"\n", | ||
"name = input(\"Hello! What is your name?\\n\")\n", | ||
"\n", | ||
"number = random.randint(1, 20)\n", | ||
"print(\"Well, {0}, I am thinking of a number between 1 and 20.\".format(name)) # E501 line too long (80 > 79 characters)\n", | ||
"\n", | ||
"while guesses_made < 6:\n", | ||
"\n", | ||
" guess = int(input(\"Take a guess: \"))\n", | ||
"\n", | ||
" guesses_made += 1\n", | ||
"\n", | ||
" if guess < number:\n", | ||
" print(\"Your guess is too low.\")\n", | ||
"\n", | ||
" if guess > number:\n", | ||
" print(\"Your guess is too high.\")\n", | ||
"\n", | ||
" if guess == number:\n", | ||
" break\n", | ||
"\n", | ||
"if guess == number:\n", | ||
" print(\n", | ||
" \"Good job, {0}! You guessed my number in {1} guesses!\".format(\n", | ||
" name, guesses_made\n", | ||
" )\n", | ||
" )\n", | ||
"else:\n", | ||
" print(\"Nope. The number I was thinking of was {0}\".format(number))\n", | ||
"\n", | ||
"import itertools # E402 module level import not at top of file" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"\"\"\"Small test script taken from https://wiki.python.org/moin/SimplePrograms\"\"\"\n", | ||
"\n", | ||
"import pwd # F401 'os' imported but unused\n", | ||
"import grp # F401 'os' imported but unused\n", | ||
"\n", | ||
"BOARD_SIZE = 8\n", | ||
"\n", | ||
"### E265 block comment should start with '# '\n", | ||
"print(\"Hello from reviewdog!\")\n", | ||
"print(\"Let's play a small queen problem game to test the flake8 github action.\")\n", | ||
"print(\"This game is taken from https://wiki.python.org/moin/SimplePrograms.\")\n", | ||
"\n", | ||
"class BailOut(Exception):\n", | ||
" pass\n", | ||
"\n", | ||
"def validate(queens):\n", | ||
" left = right = col = queens[-1] # E501 line too long (80 > 79 characters). Long description text\n", | ||
" for r in reversed(queens[:-1]):\n", | ||
" left, right = left-1, right+1\n", | ||
" if r in (left, col, right):\n", | ||
" raise BailOut\n", | ||
"\n", | ||
"def add_queen(queens):\n", | ||
" for i in range(BOARD_SIZE):\n", | ||
" test_queens = queens + [i]\n", | ||
" try:\n", | ||
" validate(test_queens)\n", | ||
" if len(test_queens) == BOARD_SIZE:\n", | ||
" return test_queens\n", | ||
" else:\n", | ||
" return add_queen(test_queens)\n", | ||
" except BailOut:\n", | ||
" pass\n", | ||
" raise BailOut" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"queens = add_queen([])\n", | ||
"print (queens)\n", | ||
"print (\"\\n\".join(\". \"*q + \"Q \" + \". \"*(BOARD_SIZE-q-1) for q in queens))\n", | ||
"\n", | ||
"import dis # E402 module level import not at top of file" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |