Skip to content

Commit

Permalink
Merge pull request #120 from cs50/autopep8
Browse files Browse the repository at this point in the history
Replace Black with autopep8 as the Python formatter
  • Loading branch information
rongxin-liu authored Jan 4, 2024
2 parents 51d7fd7 + bf3ccc0 commit 6177cb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
long_description_content_type="text/markdown",
install_requires=[
"argparse",
"black>=23.10.0",
"autopep8>=2.0.0",
"icdiff",
"jsbeautifier",
"pycodestyle==2.10.0",
Expand All @@ -40,6 +40,6 @@
]
},
url="https://github.com/cs50/style50",
version="2.9.1",
version="2.10.0",
include_package_data=True,
)
6 changes: 3 additions & 3 deletions style50/languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
from tokenize import generate_tokens, STRING, INDENT, COMMENT, TokenError

import black
import autopep8
import jsbeautifier

from . import StyleCheck, Error
Expand Down Expand Up @@ -66,9 +66,9 @@ def count_lines(self, code):
"""
return len(code.splitlines())

# TODO: Determine which options (if any) should be passed to black
# TODO: Determine which options (if any) should be passed to autopep8
def style(self, code):
return black.format_str(code, mode=black.FileMode())
return autopep8.fix_code(code, options={"max_line_length": 132, "ignore_local_config": True})


class Js(C):
Expand Down

0 comments on commit 6177cb7

Please sign in to comment.