foxundermoon / vs-shell-format Goto Github PK
View Code? Open in Web Editor NEWthe shellscript、Dockerfile、properties ...... format extension
License: MIT License
the shellscript、Dockerfile、properties ...... format extension
License: MIT License
I want to assign the dns result to dns_server
by networksetup -getdnsservers Wi-Fi
in the shellscript, but after I format it, the formatter replace `` into $()
, show as below:
before format:
dns_server=`networksetup -getdnsservers Wi-Fi`
after format:
dns_server=$(networksetup -getdnsservers Wi-Fi)
Would it be possible to recommend adding the #!
line in bash files?
when I format in nginx.conf file, it reported an error. It like this
"}" can only be used to close a block
And then in the file, it displayed an error icon like wavy line.It can be very uncomfortable
Please add a license so that the terms of use for this open source software are clear!
https://marketplace.visualstudio.com/items?itemName=foxundermoon.shell-format#overview
in details in market place, details page is still showing:
go get -u github.com/mvdan/sh/cmd/shfmt
please update that since above has been deprecated
Hi - great product.
This works fine when I am using .sh files but it's also formatting my .env files - which is causing my vars to be broken as its splitting strings etc...
I receive the notification to install shfm using the command go get -u github.com/mvdan/sh/cmd/shfmt
.
But it doesn't work. I receive the following output.
$ go get -u github.com/mvdan/sh/cmd/shfmt
# github.com/mvdan/sh/cmd/shfmt
/opt/go/src/github.com/mvdan/sh/cmd/shfmt/main.go:156: undefined: io.SeekStart
for example: you have script:
[ ... ] \
&& {...;}
after first run with -bn you'll get
[ ... ] \
\
&& {...;}
after second:
[ ... ] \
\
\
&& {...;}
and so on...
Remove trailing slashes, causing RUN
command to fail.
Before format:
FROM alpine:3.9
RUN apk add --no-cache \
bash \
python \
py-pip \
&& pip install awscli --upgrade \
&& apk del py-pip
CMD ["/bin/bash"]
After format:
FROM alpine:3.9
RUN apk add --no-cache \
bash \
python \
py-pip &&
pip install awscli --upgrade &&
apk del py-pip
CMD ["/bin/bash"]
brew install shfmt
Error: Your Xcode (1) is too outdated.
Please update to Xcode 9.0 (or delete it).
Xcode can be updated from
https://developer.apple.com/download/more/
Error: Your Command Line Tools are too outdated.
Update them from Software Update in the App Store.
but my Xcode version is 10.1
xcodebuild -version
Xcode 10.1
Literally a copy-paste of the console output:
downloaded:[0.50%]
downloaded:[0.52%]
downloaded:[1.02%]
downloaded:[1.05%]
downloaded:[1.55%]
downloaded:[1.58%]
downloaded:[2.08%]
downloaded:[2.12%]
downloaded:[2.62%]
downloaded:[2.65%]
downloaded:[3.15%]
downloaded:[3.18%]
downloaded:[3.68%]
downloaded:[3.71%]
downloaded:[4.21%]
downloaded:[4.25%]
downloaded:[4.75%]
downloaded:[4.78%]
downloaded:[5.28%]
downloaded:[5.31%]
downloaded:[5.81%]
downloaded:[5.84%]
downloaded:[6.35%]
downloaded:[6.38%]
downloaded:[6.88%]
downloaded:[6.91%]
downloaded:[7.41%]
downloaded:[7.44%]
downloaded:[7.94%]
downloaded:[7.98%]
downloaded:[8.48%]
downloaded:[8.51%]
downloaded:[9.01%]
downloaded:[9.04%]
downloaded:[9.54%]
downloaded:[9.57%]
downloaded:[10.07%]
downloaded:[10.11%]
downloaded:[10.61%]
downloaded:[10.64%]
downloaded:[11.14%]
downloaded:[11.17%]
downloaded:[11.67%]
downloaded:[11.70%]
downloaded:[12.20%]
downloaded:[12.24%]
downloaded:[12.74%]
downloaded:[12.77%]
downloaded:[13.27%]
downloaded:[13.30%]
downloaded:[13.80%]
downloaded:[13.83%]
downloaded:[14.33%]
downloaded:[14.37%]
downloaded:[14.87%]
downloaded:[14.90%]
downloaded:[15.40%]
downloaded:[15.43%]
downloaded:[15.93%]
downloaded:[15.96%]
downloaded:[16.47%]
downloaded:[16.50%]
downloaded:[17.00%]
downloaded:[17.03%]
downloaded:[17.53%]
downloaded:[17.56%]
downloaded:[18.06%]
downloaded:[18.10%]
downloaded:[18.60%]
downloaded:[18.63%]
downloaded:[19.13%]
downloaded:[19.16%]
downloaded:[19.66%]
downloaded:[19.69%]
downloaded:[20.19%]
downloaded:[20.23%]
downloaded:[20.73%]
downloaded:[20.76%]
downloaded:[21.26%]
downloaded:[21.29%]
downloaded:[21.79%]
downloaded:[21.82%]
downloaded:[22.32%]
downloaded:[22.36%]
downloaded:[22.86%]
downloaded:[22.89%]
downloaded:[23.39%]
downloaded:[23.42%]
downloaded:[23.92%]
downloaded:[23.95%]
downloaded:[24.45%]
downloaded:[24.49%]
downloaded:[24.99%]
downloaded:[25.02%]
downloaded:[25.52%]
downloaded:[25.55%]
downloaded:[26.05%]
downloaded:[26.08%]
downloaded:[26.59%]
downloaded:[26.62%]
downloaded:[27.12%]
downloaded:[27.15%]
downloaded:[27.65%]
downloaded:[27.68%]
downloaded:[28.18%]
downloaded:[28.22%]
downloaded:[28.72%]
downloaded:[28.75%]
downloaded:[29.25%]
downloaded:[29.28%]
downloaded:[29.78%]
downloaded:[29.81%]
downloaded:[30.31%]
downloaded:[30.35%]
downloaded:[30.85%]
downloaded:[30.88%]
downloaded:[31.38%]
downloaded:[31.41%]
downloaded:[31.91%]
downloaded:[31.94%]
downloaded:[32.44%]
downloaded:[32.48%]
downloaded:[32.98%]
downloaded:[33.01%]
downloaded:[33.51%]
downloaded:[33.54%]
downloaded:[34.04%]
downloaded:[34.07%]
downloaded:[34.57%]
downloaded:[34.61%]
downloaded:[35.11%]
downloaded:[35.14%]
downloaded:[35.64%]
downloaded:[35.67%]
downloaded:[36.17%]
downloaded:[36.20%]
downloaded:[36.71%]
downloaded:[36.74%]
downloaded:[37.24%]
downloaded:[37.27%]
downloaded:[37.77%]
downloaded:[37.80%]
downloaded:[38.30%]
downloaded:[38.34%]
downloaded:[38.84%]
downloaded:[38.87%]
downloaded:[39.37%]
downloaded:[39.40%]
downloaded:[39.90%]
downloaded:[39.93%]
downloaded:[40.43%]
downloaded:[40.47%]
downloaded:[40.97%]
downloaded:[41.00%]
downloaded:[41.50%]
downloaded:[41.53%]
downloaded:[42.03%]
downloaded:[42.06%]
downloaded:[42.56%]
downloaded:[42.60%]
downloaded:[43.10%]
downloaded:[43.13%]
downloaded:[43.63%]
downloaded:[43.66%]
downloaded:[44.16%]
downloaded:[44.19%]
downloaded:[44.69%]
downloaded:[44.73%]
downloaded:[45.23%]
downloaded:[45.26%]
downloaded:[45.76%]
downloaded:[45.79%]
downloaded:[46.29%]
downloaded:[46.32%]
downloaded:[46.83%]
downloaded:[46.86%]
downloaded:[47.36%]
downloaded:[47.39%]
downloaded:[47.89%]
downloaded:[47.92%]
downloaded:[48.42%]
downloaded:[48.46%]
downloaded:[48.96%]
downloaded:[48.99%]
downloaded:[49.49%]
downloaded:[49.52%]
downloaded:[50.02%]
downloaded:[50.05%]
downloaded:[50.55%]
downloaded:[50.59%]
downloaded:[51.09%]
downloaded:[51.12%]
downloaded:[51.62%]
downloaded:[51.65%]
downloaded:[52.15%]
downloaded:[52.18%]
downloaded:[52.68%]
downloaded:[52.72%]
downloaded:[53.22%]
downloaded:[53.25%]
downloaded:[53.75%]
downloaded:[53.78%]
downloaded:[54.28%]
downloaded:[54.31%]
downloaded:[54.81%]
downloaded:[54.85%]
downloaded:[55.35%]
downloaded:[55.38%]
downloaded:[55.88%]
downloaded:[55.91%]
downloaded:[56.41%]
downloaded:[56.44%]
downloaded:[56.95%]
downloaded:[56.98%]
downloaded:[57.48%]
downloaded:[57.51%]
downloaded:[58.01%]
downloaded:[58.04%]
downloaded:[58.54%]
downloaded:[58.58%]
downloaded:[59.08%]
downloaded:[59.11%]
downloaded:[59.61%]
downloaded:[59.64%]
downloaded:[60.14%]
downloaded:[60.17%]
downloaded:[60.67%]
downloaded:[60.71%]
downloaded:[61.21%]
downloaded:[61.24%]
downloaded:[61.74%]
downloaded:[61.77%]
downloaded:[62.27%]
downloaded:[62.30%]
downloaded:[62.80%]
downloaded:[62.84%]
downloaded:[63.34%]
downloaded:[63.37%]
downloaded:[63.87%]
downloaded:[63.90%]
downloaded:[64.40%]
downloaded:[64.43%]
downloaded:[64.93%]
downloaded:[64.97%]
downloaded:[65.47%]
downloaded:[65.50%]
downloaded:[66.00%]
downloaded:[66.03%]
downloaded:[66.53%]
downloaded:[66.56%]
downloaded:[67.07%]
downloaded:[67.10%]
downloaded:[67.60%]
downloaded:[67.63%]
downloaded:[68.13%]
downloaded:[68.16%]
downloaded:[68.66%]
downloaded:[68.70%]
downloaded:[69.20%]
downloaded:[69.23%]
downloaded:[69.73%]
downloaded:[69.76%]
downloaded:[70.26%]
downloaded:[70.29%]
downloaded:[70.79%]
downloaded:[70.83%]
downloaded:[71.33%]
downloaded:[71.36%]
downloaded:[71.86%]
downloaded:[71.89%]
downloaded:[72.39%]
downloaded:[72.42%]
downloaded:[72.92%]
downloaded:[72.96%]
downloaded:[73.46%]
downloaded:[73.49%]
downloaded:[73.99%]
downloaded:[74.02%]
downloaded:[74.52%]
downloaded:[74.55%]
downloaded:[75.05%]
downloaded:[75.09%]
downloaded:[75.59%]
downloaded:[75.62%]
downloaded:[76.12%]
downloaded:[76.15%]
downloaded:[76.65%]
downloaded:[76.68%]
downloaded:[77.19%]
downloaded:[77.22%]
downloaded:[77.72%]
downloaded:[77.75%]
downloaded:[78.25%]
downloaded:[78.28%]
downloaded:[78.78%]
downloaded:[78.82%]
downloaded:[79.32%]
downloaded:[79.35%]
downloaded:[79.85%]
downloaded:[79.88%]
downloaded:[80.38%]
downloaded:[80.41%]
downloaded:[80.91%]
downloaded:[80.95%]
downloaded:[81.45%]
downloaded:[81.48%]
downloaded:[81.98%]
downloaded:[82.01%]
downloaded:[82.51%]
downloaded:[82.54%]
downloaded:[83.04%]
downloaded:[83.08%]
downloaded:[83.58%]
downloaded:[83.61%]
downloaded:[84.11%]
downloaded:[84.14%]
downloaded:[84.64%]
downloaded:[84.67%]
downloaded:[85.17%]
downloaded:[85.21%]
downloaded:[85.71%]
downloaded:[85.74%]
downloaded:[86.24%]
downloaded:[86.27%]
downloaded:[86.77%]
downloaded:[86.80%]
downloaded:[87.31%]
downloaded:[87.34%]
downloaded:[87.84%]
downloaded:[87.87%]
downloaded:[88.37%]
downloaded:[88.40%]
downloaded:[88.90%]
downloaded:[88.93%]
downloaded:[89.44%]
downloaded:[89.47%]
downloaded:[89.97%]
downloaded:[90.00%]
downloaded:[90.50%]
downloaded:[90.53%]
downloaded:[91.03%]
downloaded:[91.07%]
downloaded:[91.57%]
downloaded:[91.60%]
downloaded:[92.10%]
downloaded:[92.13%]
downloaded:[92.63%]
downloaded:[92.66%]
downloaded:[93.16%]
downloaded:[93.20%]
downloaded:[93.70%]
downloaded:[93.73%]
downloaded:[94.23%]
downloaded:[94.26%]
downloaded:[94.76%]
downloaded:[94.79%]
downloaded:[95.29%]
downloaded:[95.33%]
downloaded:[95.83%]
downloaded:[95.86%]
downloaded:[96.36%]
downloaded:[96.39%]
downloaded:[96.89%]
downloaded:[96.92%]
downloaded:[97.43%]
downloaded:[97.46%]
downloaded:[97.96%]
downloaded:[97.99%]
downloaded:[98.49%]
downloaded:[98.52%]
downloaded:[99.02%]
downloaded:[99.05%]
downloaded:[99.56%]
downloaded:[99.59%]
downloaded:[100.00%]
This happens so fast, it's impossible to control/see what's happening and why. Can the output be throttled such that it's once per second or per 1% download whichever is more? If I read the code correctly, currently, the output is per chunk which doesn't make sense from ux pov.
Even using dots per percent and a detailed print every 5% would be more than informative enough.
Example (one dot per chunk which is not bringing the count to multiples of 5)
downloaded: [0.50%].................
downloaded: [5.28%]
and so on
hbarta@baobabb:~$ mkdir -p /usr/local/bin
hbarta@baobabb:~$ curl -L 'https://github.com/mvdan/sh/releases/download/v2.6.2/shfmt_v2.6.2_linux_amd64' --output /usr/local/bin/shfmt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 614 0 614 0 0 1149 0 --:--:-- --:--:-- --:--:-- 1149
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0Warning: Failed to create the file /usr/local/bin/shfmt: Permission denied
0 2826k 0 16360 0 0 12791 0 0:03:46 0:00:01 0:03:45 69617
curl: (23) Failed writing body (0 != 16360)
hbarta@baobabb:~$ chmod a+x /usr/local/bin/shfmt
chmod: cannot access '/usr/local/bin/shfmt': No such file or directory
hbarta@baobabb:~$ echo '**Enjoy shellscript!**'
**Enjoy shellscript!**
hbarta@baobabb:~$ echo 'fork or star https://github.com/foxundermoon/vs-shell-format'
fork or star https://github.com/foxundermoon/vs-shell-format
hbarta@baobabb:~$
/usr/local/bin is not writable by the user unless they are logged in as root. There are a couple possible fixes for this. One is to prefix the command with sudo
(e.g. sudo mkdir -p /usr/local/bin
) Which will prompt for the user's password (and will work if they are allowed to use the sudo
command and it is installed.)
Another - and probably safer - alternative is to put the executable in ~/bin
(expands to /home/<username>/bin
) and is writable by the user without elevating privileges. If the directory exists, it will probably be in the $PATH
. If not, it will be there on the next login. If your plugin provides the full path to shfmt, it should always work.
This is probably common to most, if not all, Linux variants.
Hi there,
I just noticed this, because my backup tool complained that it wasn't allowed to copy shfmt_v2.6.4_linux_amd64
. I'm wondering what's with the strange permission of that file?
$ ls -la ~/.vscode-oss/extensions/foxundermoon.shell-format-6.1.1/bin | grep shfmt
drwxr-xr-x 2 peter peter 4096 Aug 16 13:01 .
drwxr-xr-x 4 peter peter 4096 Aug 16 13:01 ..
--wxrw--wt 1 peter peter 3005216 Aug 16 13:01 shfmt_v2.6.4_linux_amd64
When running format on Dockerfiles it removes all of the \
and line endings. This causes RUN commands in docker build to not work.
Runnning shell-format 4.0.4 and shfmt 2.6.3
See mvdan/sh#446
Hi,
If I write for example:
days=$(echo $1 | perl -ne '/(\d*) day/ && print"$1"')
then the perl -ne is not formatted as expected
Is it possible to make = same class as if, then etc?
how does the recognition of applications work?
shfmt offers -i N
to indent with a number of spaces instead of tabs. It'd make sense to expose this as Visual Studio Code user configuration.
vscode logs : (vscode version :1.30.2)
"shellformat.path": "/usr/local/bin/shfmt" find config shellformat path ,but the file cannot execute or not exists, so will auto download shfmt
shfmt hasn't downloaded yet!TypeError: Cannot read property 'stat' of undefined
Shfmt will be downloaded automatically!
download url: https://github.com/mvdan/sh/releases/download/v2.6.4/shfmt_v2.6.4_darwin_amd64
download to: /usr/local/bin/shfmt
If the download fails, you can manually download it to the dest directory.
Or download to another directory, and then set the "shellformat.path" as the path
download shfmt page: https://github.com/mvdan/sh/releases
You can't use this plugin until the download is successful.
download failed: Error: EACCES: permission denied, open '/usr/local/bin/shfmt'
file shfmt
ls -l /usr/local/bin/shfmt
lrwxr-xr-x 1 liuchuanfeng admin 39 10 30 16:09 /usr/local/bin/shfmt -> /usr/local/Cellar/shfmt/2.6.4/bin/shfmt
shfmt version
/usr/local/bin/shfmt --version
v2.6.4
actually ,it's ok to use it format shell file;but always ouput fail and try download ;pls help it
Hello,
In VSCode I cannot set the increment anymore (my shfmt version is 2.5.1)
Whatever the -i number I used I have 5 whitespace in my script.
Please note
I really think it is not linked to shfmt himself but it's integration in VSCode.
Perhaps something is running at 'Format document' after shfmt which change the indent to '5'
But I have no idea of how I can debug this.
Note than before this was integrated to the 'system' Format Document, I had no problem ... I am so sad ...
In order to help you, is there a way to debug this?
Thanks in advance for your help, regards,
Pierre
The code
#!/bin/sh
if [ "${a}" = "a" ]; then
echo "toto"
echo "toto" > tata
fi
the options:
"shellformat.flag": "-i 0 -p -ci -sr -kp",
"shellformat.path": "E:\programfiles\shfmt\shfmt.exe",
"shellformat.showError": true,
Hi there, I have shfmt setup in Vscode to format on save. For some reason, the extension is trying to process a Vala file I am working on. Is there a way to disable for a certain file type?
Hello, thanks for this wonderful extension!
I am using VS Code Version 1.13.1 on Linux Fedora 25
When i use the format short-cut 'Shift+Ctrl I' if there are no errors it formats. If there are errors then nothing happens!
If I press F1 and select 'format shell with shfmt' then I see the error message appear that should also appear when I press the shortcut.
Thanks :)
I have my package manager to install shfmt and I definitely don't want the extension to fetch any blobs from the Internet. The extension keeps downloading it even when I delete the binary.
Hello, sorry I am a newly in Linux (and in english) and I have perhaps make a mistake.
I have updated VS code and it works fine.
I have kept shell-format extension (same place, same options) I have no notification nor errors nor problem in the VS logs.
But I cannot find shell-format command in F1, it does not appears. In terminal I wrote "shfmt -version" and it answer V2.5.0.
Please what can i do to retreive my command?
Thanks a lot,
Pierre
I just installed vs-shell-format in order to have a shellscript formatter available to my VSCode workspace. It looks like document formatting works fine (ie, ALT-SHIFT-F
to format the entire document), but selection formatting is not (ie, CMD-K CMD-F
on highlighted text). It would be ideal if this extension supported both document formatting and selection formatting. I'm not sure if this is a feature request (has not yet been implemented in this extension) or a bug report (ie, it should work but it is not).
My workspace info:
Thank you!
Is there a flag to disable newline at EOF for bash scripts for shell-format.
When I disable the extension, the newline is not added.
a. Why must you run the command?
b. Why so often?
c. Why in the VS Code Terminal?
In script,the comparison between string and string.it will be like if [ $1 = "String" ].But use the plugin to format,this will change to if [ $1="String" ],this behaviour will change the result of this expression.
When the extension automatically updates shellfmt
, focus is stolen by the Output window which shows up to report download process. I experienced this while writing a Rust file, and every time it reported the download progress percentage, my cursor was moved back to the output window, so I was forced to wait until the download finished.
Hi, thanks for the extension!
shfmt
supports using a .editorconfig
to define settings. I have the following a the root of the project:
[*]
indent_style = space
indent_size = 4
binary_next_line = true
switch_case_indent = true
This works as expected using shfmt
from the terminal, however using this extension those settings are ignored. Just wondering if this is expected?
https://github.com/mvdan/sh/releases/download/v2.6.4/shfmt_v2.6.4_windows_amd64.exe
is arbitrary and out of the extension's control. This would be different if this extension is being published by @mdvan. Additionally, no one should trust extension didn't modify the URL to their own payload. [1] [2] [3]
Most systems run behind a package system (brew
, chocolately
, apt
etc), which incorporate their own flows for getting packages to a system and safeguards (e.g. checksumming executable etc).
Instead, consider outputting instructions on how to safely source shfmt
, for example:
shfmt doesn't appear to be available! We checked your $PATH, C:\bin, and C:\Windows\system32 and couldn't find shfmt.exe.
Based on detected OS (Windows), here are some options to make shfmt available:
Follow shfmt github instructions:
https://github.com/mvdan/sh#shfmtDownload using chocolatey:
https://chocolatey.org/search?q=shfmtDownload directly from https://github.com/mvdan/sh/releases and save into C:\bin\shfmt.exe (or anywhere in $PATH)
shfmt
The logic to identify if shfmt
is available on local machine/path is broken - it didn't detect the installed/available version of shfmt
on the system.
I understand what this extension is trying to do (make it easy for this extension to work), but its breaking some cardinal security rules. Implementing some of the safety check (checksum executable) would not change this - extensions shouldn't source arbitrary binaries.
I manually download shfmt to the dest directory.
But it disappear after the vscode reload
I have installed the shfmt binary release file in usr/local/bin/shfmt
I have also installed it using go get -u github.com/mvdan/sh/cmd/shfmt
in $HOME/go/bin/shfmt
I tried set shellformat.path to both paths, but neither worked.
System: Ubuntu 16.04
Go version: 1.9.2
shfmt version: 2.2.0
Hi, I'm trying out your Visual Studio Code Extension, but I can't get it to run. I guess I must be stupid.
I'm on Windows 10 1803 x64. Visual Studio Code:
Version: 1.29.1 (user setup)
Commit: bc24f98b5f70467bc689abf41cc5550ca637088e
Datum: 2018-11-15T19:13:36.375Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architektur: x64
I've downloaded "https://github.com/mvdan/sh/releases/download/v2.6.2/shfmt_v2.6.2_windows_amd64.exe" and placed it in a folder.
I then added the path to my custom user settings:
But regardless what path I enter, I get the error message: [shellformat.path] not configured
Things I tried:
"C:\#Apps\shfmt_v2.6.2_windows_amd64.exe"
"C:\\#Apps\\shfmt_v2.6.2_windows_amd64.exe"
"C:/#Apps/shfmt_v2.6.2_windows_amd64.exe"
"C:\shfmt_v2.6.2_windows_amd64.exe"
"C:\\shfmt_v2.6.2_windows_amd64.exe"
"C:/shfmt_v2.6.2_windows_amd64.exe"
"C:\shfmt.exe"
"C:\\shfmt.exe"
"C:/shfmt.exe"
I've no idea what basic thing I'm doing wrong. Can you help me please?
Is there a version of the Dockerfile formatter that this extension uses that we could call from the shell for usage on CI?
Please take a look at the formatting of code below:
RETVAL='sqlplus -S ${V_ETL_TECH_LOGIN} <<EOF
${SQL_COMMAND}
EOF'
#lines below are green as if they were a part of text above
ERROR_CODE=$?
Lines below are no longer properly formatted (colored).
The good example of what I mean is to take a look at the Sublime Text editor code.
Well, to be honest, recently I realized that even in Sublime Text this example is wrongly formatted. It colorize commands like "if" but forget about variables.
From free editors I use now the best formatting is offered by Notepad++. Please take a look for examples there.
With following flags:
"shellformat.flag": "-p"
shift + option + L renders following alert:
Would it possible to incorporate the shfmt >/dev/null
behavior (described here) to show errors in the problems section? Similar to how shellcheck works:
In my project's folder, I have a .vscode/settings.json
containing
{
"shellformat.flag": "-sr",
"editor.tabSize": 4,
"editor.detectIndentation": true,
"editor.renderWhitespace": "all",
"editor.formatOnSave": true,
}
When I add my folder in a newly created workspace everything goes well. When I had more folders into the workspace, properties shellformat.*
at the project level are not taken into account anymore.
I get a message saying
This setting cannot be applied in this workspace. It will be applied when you open the containing workspace folder directly.
The README mentions many donation methods, saying that they will make shell-format better. Please clarify that these donations won't reach shfmt
, as I didn't even know anyone was receiving donations for software sitting on top of mine.
To clarify, I don't mind if you do take donations. But please make it clear that the donations may make the plugin better, but not the actual shell formatting software that it depends on.
Using variables in the path causes an invalid error:
"shellformat.path": "${HOME}/go/bin/shfmt"
or ${env:HOME}
Error:
the config shellformat.path file not exists please fix it
However apart from the error, the extension works fine.
I use those setting:
"shellformat.flag": "-i 2 -sr -bn",
"shellformat.runOnSave": true,
Sometimes, when I save REAME.md, it will do format and repace ` with $() .
Hi,
I've been using this extension for a while and I like it. But for Dockerfile, I prefer not to enable the auto formatting.
How to disable it?
Thanks.
Hi
I install the shell-format 0.1.3 in the vscode but it don´t run.
I try to run in the console with format shell with shfmt option but the code in bash and ksh shell is the same and not formated.
My version of the softwares:
C:\Users\claud\t>ver
Microsoft Windows [versão 10.0.14393]
C:\Users\claud\t>go version
go version go1.8 windows/amd64
C:\Users\claud\t>shfmt -version
v1.2.0
would be a nice to have :)
when i format bash script, it will change echo $[ $1 *
and it will occur error.
Running the formatter in vscode throws
Cannot read property 'substring' of undefined
However, after running shfmt -w myscript.sh
once from the command line manually, it worked fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.