diff --git a/.github/workflows/python-format.yml b/.github/workflows/python-format.yml index 3f84f822..71331888 100644 --- a/.github/workflows/python-format.yml +++ b/.github/workflows/python-format.yml @@ -27,4 +27,5 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} black: true + black_args: --line-length 79 # same max line length as flake8 auto_fix: true # auto commit style fixes \ No newline at end of file diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml index 1e0834cc..308b56a8 100644 --- a/.github/workflows/python-lint.yml +++ b/.github/workflows/python-lint.yml @@ -1,5 +1,4 @@ - -# Uses (Lint Action): https://github.com/marketplace/actions/lint-action#supported-tools +# Uses (Lintly): https://github.com/grantmcconnaughey/Lintly # Submits code reviews based on flake8 output name: Python (Lintly) @@ -19,12 +18,12 @@ jobs: with: python-version: '3.x' - # Install flake8 and lintly + # Install flake8 and Lintly - name: Install Python dependencies run: pip install flake8 lintly # Run Lintly with flake8 - name: Lint with flake8 - run: flake8 | lintly --commit-sha=${{ github.event.pull_request.head.sha }} --format=flake8 + run: flake8 | lintly --commit-sha=${{ github.event.pull_request.head.sha }} env: LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }} diff --git a/1_beginner/chapter2/solutions/favorite.py b/1_beginner/chapter2/solutions/favorite.py index ba82814c..0915dcb0 100644 --- a/1_beginner/chapter2/solutions/favorite.py +++ b/1_beginner/chapter2/solutions/favorite.py @@ -9,4 +9,11 @@ favorite_person = input("Who is your favorite person? ") # Display output -print(favorite_person + " bought you " + favorite_food + " and " + favorite_drink + ".") +print( + favorite_person + + " bought you " + + favorite_food + + " and " + + favorite_drink + + "." +) diff --git a/1_beginner/chapter3/examples/logic_operators.py b/1_beginner/chapter3/examples/logic_operators.py index 1ce49f1d..26792ff6 100644 --- a/1_beginner/chapter3/examples/logic_operators.py +++ b/1_beginner/chapter3/examples/logic_operators.py @@ -11,7 +11,10 @@ # or was_computer_bought = True was_bike_bought = False -print("Was a computer or bike bought? " + str(was_computer_bought or was_bike_bought)) +print( + "Was a computer or bike bought? " + + str(was_computer_bought or was_bike_bought) +) # not is_raining = False diff --git a/1_beginner/chapter3/practice/change.py b/1_beginner/chapter3/practice/change.py index 8dfbaa6c..443b95b6 100644 --- a/1_beginner/chapter3/practice/change.py +++ b/1_beginner/chapter3/practice/change.py @@ -19,6 +19,8 @@ CENTS_PER_DOLLAR = 100 -num_cents = int(float(input("How many dollars do you have: $")) * CENTS_PER_DOLLAR) +num_cents = int( + float(input("How many dollars do you have: $")) * CENTS_PER_DOLLAR +) # What do you do next? Write code here diff --git a/1_beginner/chapter3/solutions/change.py b/1_beginner/chapter3/solutions/change.py index d693b9b1..bad5b99b 100644 --- a/1_beginner/chapter3/solutions/change.py +++ b/1_beginner/chapter3/solutions/change.py @@ -23,7 +23,9 @@ CENTS_PER_NICKEL = 5 # prompt user for dollars and convert it to cents -num_cents = int(float(input("How many dollars do you have: $")) * CENTS_PER_DOLLAR) +num_cents = int( + float(input("How many dollars do you have: $")) * CENTS_PER_DOLLAR +) # calculate change and display it dollars = num_cents // CENTS_PER_DOLLAR diff --git a/1_beginner/chapter5/practice/add_all_the_way.py b/1_beginner/chapter5/practice/add_all_the_way.py index fbd2f8a5..517f3ab8 100644 --- a/1_beginner/chapter5/practice/add_all_the_way.py +++ b/1_beginner/chapter5/practice/add_all_the_way.py @@ -1,8 +1,7 @@ # Add All the Way -# Write a program that asks for and -# reads an input from the user -# Then add all the numbers up from 0 -# to that number up. You can use a -# for or while loop. Print out the sum. +# Take a number from the user and +# add every number up from 1 to that number. +# Print the result. +# You can use a for or while loop. # write code here diff --git a/1_beginner/chapter5/practice/up_2_fifty.py b/1_beginner/chapter5/practice/up_2_fifty.py index 3d800176..d2b99f89 100644 --- a/1_beginner/chapter5/practice/up_2_fifty.py +++ b/1_beginner/chapter5/practice/up_2_fifty.py @@ -2,7 +2,7 @@ # Write a program that takes a number from the user # and adds 2 to it until it reaches 50 or more, # then prints out how many times 2 was added. -# If the number is already greater than 50, +# If the number is already 50 or greater, # then print out ('Already there!') # write code here diff --git a/1_beginner/chapter5/solutions/add_all_the_way.py b/1_beginner/chapter5/solutions/add_all_the_way.py index be0db267..84dc010c 100644 --- a/1_beginner/chapter5/solutions/add_all_the_way.py +++ b/1_beginner/chapter5/solutions/add_all_the_way.py @@ -1,9 +1,8 @@ # Add All the Way -# Write a program that asks for and -# reads an input from the user -# Then add all the numbers up from 0 -# to that number up. You can use a -# for or while loop. Print out the sum. +# Take a number from the user and +# add every number up from 1 to that number. +# Print the result. +# You can use a for or while loop. # for loop solution sum = 0 diff --git a/1_beginner/chapter5/solutions/up_2_fifty.py b/1_beginner/chapter5/solutions/up_2_fifty.py index 40547c92..1f68afe7 100644 --- a/1_beginner/chapter5/solutions/up_2_fifty.py +++ b/1_beginner/chapter5/solutions/up_2_fifty.py @@ -2,7 +2,7 @@ # Write a program that takes a number from the user # and adds 2 to it until it reaches 50 or more, # then prints out how many times 2 was added. -# If the number is already greater than 50, +# If the number is already 50 or greater, # then print out ('Already there!') # prompt user for a number