diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml new file mode 100644 index 0000000..23e5f90 --- /dev/null +++ b/.github/workflows/linting.yaml @@ -0,0 +1,30 @@ +name: Linting + +on: + push: + branches: [ "main", "master" ] + pull_request: + branches: [ "main", "master" ] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: Install Ruff + run: | + python -m pip install --upgrade pip + pip install ruff + + - name: Run Ruff Lint + run: ruff check . + + - name: Run Ruff Format Check + run: ruff format --check . \ No newline at end of file diff --git a/barevnyornament.py b/barevnyornament.py index 2b1bf55..26f58df 100644 --- a/barevnyornament.py +++ b/barevnyornament.py @@ -2,7 +2,6 @@ from turtle import exitonclick, bgcolor, title, colormode import turtle -from random import randint def cara(t, strana, barva): diff --git a/crazyvilllage.py b/crazyvilllage.py index 33ff0ed..c841ffd 100644 --- a/crazyvilllage.py +++ b/crazyvilllage.py @@ -2,10 +2,8 @@ from turtle import exitonclick, bgcolor, title, colormode import turtle -from random import randint -# ze souboru vesnice je potřeba funkce domecek -from vesnice import * +from vesnice import domecek import tkinter @@ -48,7 +46,6 @@ def main(): velikostDomecku = 3 for _ in range(20): - barva = (red, green, 0) posun(t, dilek) dilek = dilek + 20 diff --git a/dlazdice.py b/dlazdice.py index e2ac9f4..3229bcc 100644 --- a/dlazdice.py +++ b/dlazdice.py @@ -1,9 +1,8 @@ # nakreslí vesnici pomocí knihovny turtle -from turtle import exitonclick, bgcolor, screensize, title, colormode +from turtle import exitonclick, bgcolor, title, colormode import turtle -from random import randint, randrange -import math +from random import randint def dlazdice(t, strana, barva): diff --git a/doc/LICENSE.txt b/doc/LICENSE.txt new file mode 100644 index 0000000..85af261 --- /dev/null +++ b/doc/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) [2024] [hrosicka] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/fialovyornament.py b/fialovyornament.py index a6cd4ae..4efb6da 100644 --- a/fialovyornament.py +++ b/fialovyornament.py @@ -1,6 +1,6 @@ # nakreslí vesnici pomocí knihovny turtle -from turtle import exitonclick, bgcolor, screensize, title, colormode +from turtle import exitonclick, bgcolor, title, colormode import turtle from random import randint diff --git a/modrozelenyornament.py b/modrozelenyornament.py index 062814d..82ddf77 100644 --- a/modrozelenyornament.py +++ b/modrozelenyornament.py @@ -1,9 +1,8 @@ # nakreslí vesnici pomocí knihovny turtle -from turtle import exitonclick, bgcolor, screensize, title, colormode +from turtle import exitonclick, bgcolor, title, colormode import turtle from random import randint -import math def cara(t, strana, barva): diff --git a/sinewaves.py b/sinewaves.py index 4b98509..89b5fbf 100644 --- a/sinewaves.py +++ b/sinewaves.py @@ -1,10 +1,8 @@ # nakreslí vesnici pomocí knihovny turtle -from turtle import exitonclick, bgcolor, title, colormode +from turtle import exitonclick, bgcolor, title import turtle -from random import randint import math -import turtle bgcolor("lightblue") title("Sine Waves") diff --git a/vesnice.py b/vesnice.py index e43185b..806a0a8 100644 --- a/vesnice.py +++ b/vesnice.py @@ -74,7 +74,6 @@ def main(): # vesnice má 100 domečků for _ in range(100): - # náhodně určená poloha domku z intervalu x = randint(-300, 300) y = randint(-300, 300)