The results of beautification are not what I expected because it simply crashed.
usage: beautysh [--indent-size INDENT_SIZE] [--backup] [--check] [--tab] [--force-function-style FORCE_FUNCTION_STYLE] [--version] [--help] [FILE [FILE ...]] beautysh: error: unrecognized arguments: -f
usage: beautysh [--indent-size INDENT_SIZE] [--backup] [--check] [--tab]
[--force-function-style FORCE_FUNCTION_STYLE] [--version]
[--help]
[FILE [FILE ...]]
beautysh: error: unrecognized arguments: -f
Atom Beautify: Beautify EditorHere is a link to the debug.md Gist: https://gist.github.com/MatthewWolff/a6e504ca47deffeab27a29367ccf9d6c
I have:
Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issueThis error occurs regardless of the code. It doesn't seem to be even initiating properly.
Using
prettierto format JavaScript I also encountered an error
Until the PR gets merged, you can downgrade to a beautysh version that still has support for the now missing -f flag. Put this in your terminal pip install beautysh==4.1
Downgrading to beautysh 4.1 and using Python 3.8.0 I got the following:
Traceback (most recent call last):
File "c:\python38\lib\runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\python38\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python38\Scripts\beautysh.exe\__main__.py", line 7, in <module>
File "c:\python38\lib\site-packages\beautysh\beautysh.py", line 28, in main
Beautify().main()
File "c:\python38\lib\site-packages\beautysh\beautysh.py", line 361, in main
error |= self.beautify_file(path)
File "c:\python38\lib\site-packages\beautysh\beautysh.py", line 273, in beautify_file
result, error = self.beautify_string(data, path)
File "c:\python38\lib\site-packages\beautysh\beautysh.py", line 145, in beautify_string
if(re.search(here_string, test_record) and not
File "c:\python38\lib\re.py", line 199, in search
return _compile(pattern, flags).search(string)
File "c:\python38\lib\re.py", line 302, in _compile
p = sre_compile.compile(pattern, flags)
File "c:\python38\lib\sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
File "c:\python38\lib\sre_parse.py", line 948, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "c:\python38\lib\sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "c:\python38\lib\sre_parse.py", line 549, in _parse
raise source.error("unterminated character set",
re.error: unterminated character set at position 21
Downgrading to
beautysh 4.1and usingPython 3.8.0I got...
well... do you think that's a bug, or just a consequence of using an older version of a syntax formatter with a version of Python that literally came out yesterday 馃憖
For anybody using Docker with beautysh and facing this issue, you'll need to create a custom Docker image to fix this:
Dockerfile in an empty directory with these contents:FROM python:alpine
LABEL io.whalebrew.name 'beautysh'
LABEL io.whalebrew.config.working_dir '/workdir'
WORKDIR /workdir
RUN pip install --upgrade beautysh==4.1
ENTRYPOINT ["beautysh"]
CMD ["--help"]
docker image build -t unibeautify/beautysh:latest .
Downgrading to beautysh 4.1 and using Python 3.7.5 fixed this for me.
Workaround:
Remove -f from %userprofile%\.atom\packages\atom-beautify\src\beautifiers\beautysh.coffee as shown at https://github.com/Glavin001/atom-beautify/pull/2385/files.
Yep, in the file atom\packages\atom-beautify\src\beautifiers\beautysh.coffee, you have to edit the beautify in the if/else condition (lines 34 to 39), like this:
if tabs is true
beautysh.run([ '-t', file ])
.then(=> @readFile file)
else
beautysh.run([ '-i', options.indent_size, file ])
.then(=> @readFile file)
Most helpful comment
Workaround:
Remove
-ffrom%userprofile%\.atom\packages\atom-beautify\src\beautifiers\beautysh.coffeeas shown at https://github.com/Glavin001/atom-beautify/pull/2385/files.