tmont/nginx-conf

Comments are not properly formatted with config

nagapavan opened this issue · 2 comments

After formatting, comments are not properly aligned.

Actual output:

http {
    include /etc/nginx/mime.types;
#gzip  on;
    include /etc/nginx/conf.d/*.conf;
    default_type application/octet-stream;
    log_format main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log /var/log/nginx/access.log  main;
    sendfile on;
#tcp_nopush     on;
    keepalive_timeout 65;
}

Expected output:

http {
    include /etc/nginx/mime.types;
    #gzip  on;
    include /etc/nginx/conf.d/*.conf;
    default_type application/octet-stream;
    log_format main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log /var/log/nginx/access.log  main;
    sendfile on;
    #tcp_nopush     on;
    keepalive_timeout 65;
}

The commented code and the blank line were deleted after formatting, I don't think this is a good experience.

tmont commented

This is by design. This is not a formatter. Unless someone wants to fix it in a PR...

But in general fancy formatting is outside the scope of this library.