Skip to content

Commit

Permalink
Merge pull request #115 from cs50/black
Browse files Browse the repository at this point in the history
Replace autopep8 with Black as the Python formatter
  • Loading branch information
rongxin-liu authored Oct 27, 2023
2 parents 4391242 + fd62fa6 commit b58023a
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",
"autopep8>=1.4.3",
"black>=23.10.0",
"icdiff",
"jsbeautifier",
"pycodestyle==2.10.0",
Expand All @@ -40,6 +40,6 @@
]
},
url="https://github.com/cs50/style50",
version="2.8.2",
version="2.9.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 autopep8
import black
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 autopep8
# TODO: Determine which options (if any) should be passed to black
def style(self, code):
return autopep8.fix_code(code, options={"max_line_length": 132, "ignore_local_config": True})
return black.format_str(code, mode=black.FileMode())


class Js(C):
Expand Down

0 comments on commit b58023a

Please sign in to comment.