From d04f6da69ae4afd3b240f1be6dc405222c9550bc Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Sun, 3 Mar 2024 15:03:40 +0700 Subject: [PATCH] set ColumnLImit to 100 --- setup.py | 2 +- style50/languages.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 23ab369..761b4c1 100644 --- a/setup.py +++ b/setup.py @@ -39,6 +39,6 @@ ] }, url="https://github.com/cs50/style50", - version="2.10.1", + version="2.10.2", include_package_data=True, ) diff --git a/style50/languages.py b/style50/languages.py index b7318f5..a11a889 100644 --- a/style50/languages.py +++ b/style50/languages.py @@ -13,7 +13,7 @@ class C(StyleCheck): extensions = ["c", "h", "cpp", "hpp"] magic_names = [] # Only recognize C files by their extension - styleConfig = '{ AllowShortFunctionsOnASingleLine: Empty, BraceWrapping: { AfterCaseLabel: true, AfterControlStatement: true, AfterFunction: true, AfterStruct: true, BeforeElse: true, BeforeWhile: true }, BreakBeforeBraces: Custom, ColumnLimit: 132, IndentCaseLabels: true, IndentWidth: 4, SpaceAfterCStyleCast: true, TabWidth: 4 }' + styleConfig = '{ AllowShortFunctionsOnASingleLine: Empty, BraceWrapping: { AfterCaseLabel: true, AfterControlStatement: true, AfterFunction: true, AfterStruct: true, BeforeElse: true, BeforeWhile: true }, BreakBeforeBraces: Custom, ColumnLimit: 100, IndentCaseLabels: true, IndentWidth: 4, SpaceAfterCStyleCast: true, TabWidth: 4 }' clangFormat = [ "clang-format", f"-style={styleConfig}" ] @@ -68,7 +68,7 @@ def count_lines(self, code): # TODO: Determine which options (if any) should be passed to autopep8 def style(self, code): - return autopep8.fix_code(code, options={"max_line_length": 132, "ignore_local_config": True}) + return autopep8.fix_code(code, options={"max_line_length": 100, "ignore_local_config": True}) class Js(C): @@ -91,7 +91,7 @@ def style(self, code): opts = jsbeautifier.default_options() opts.end_with_newline = True opts.operator_position = "preserve-newline" - opts.wrap_line_length = 132 + opts.wrap_line_length = 100 opts.brace_style = "collapse,preserve-inline" opts.keep_array_indentation = True return jsbeautifier.beautify(code, opts)