crossplane
crossplane copied to clipboard
Additional format options
Proposed changes
I was looking for a program that can format “nginx” files, but the ones I found either didn't work or didn't have sufficient options.
Here I add --align
, --spacious
and --write
options for a “format” action. These options will make “format” action more usable
-
--align
will align all the directives within a block. -
--spacious
will add spaces after blocks. -
--write
will write formatted config file in-place.
Without options:
server {
listen 443 ssl;
ssl_certificate fullchain.pem;
ssl_certificate_key privite.pem;
server_name _;
index index.html;
root /public;
charset utf-8;
expires $expires;
location ~ \d {
image_filter_buffer 5M;
image_filter_interlace on;
image_filter_jpeg_quality 75;
}
location ~ \d {
image_filter_buffer 5M;
image_filter_interlace on;
image_filter_jpeg_quality 75;
}
}
with options being set:
server {
listen 443 ssl;
ssl_certificate fullchain.pem;
ssl_certificate_key privite.pem;
server_name _;
index index.html;
root /public;
charset utf-8;
expires $expires;
location ~ \d {
image_filter_buffer 5M;
image_filter_interlace on;
image_filter_jpeg_quality 75;
}
location ~ \d {
image_filter_buffer 5M;
image_filter_interlace on;
image_filter_jpeg_quality 75;
}
}
Checklist
Before creating a PR, run through this checklist and mark each as complete.
- [x] I have read the CONTRIBUTING doc
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] I have checked that all unit tests pass after adding my changes
- [x] I have updated necessary documentation
- [ ] I have rebased my branch onto master
- [x] I will ensure my PR is targeting the master branch and pulling from my branch from my own fork