Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx: Format the config file #22209

Merged
merged 1 commit into from Feb 7, 2017
Merged

nginx: Format the config file #22209

merged 1 commit into from Feb 7, 2017

Conversation

Baughn
Copy link
Contributor

@Baughn Baughn commented Jan 27, 2017

Motivation for this change

This makes nginx.conf human-readable.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@Baughn, thanks for your PR! By analyzing the history of the files in this pull request, we identified @wlhlm, @globin and @domenkozar to be potential reviewers.

@Baughn
Copy link
Contributor Author

Baughn commented Jan 27, 2017

Example output: http://sprunge.us/WKCc

@danbst
Copy link
Contributor

danbst commented Jan 30, 2017

Nice! What about removing some blank lines, like sed 'N; /^\s*\n$/d; P; D' ?

@Baughn
Copy link
Contributor Author

Baughn commented Jan 30, 2017

I feel like that should be done in the formatter, not with sed scripts. I like my config files to have some blank lines, and think the current output is probably better than removing all of them.

But in reality, I'm unlikely to write any code to fix that. The config file is readable now.

@danbst
Copy link
Contributor

danbst commented Jan 30, 2017

You are probably right here. nginfmt should remove extra lines (quote, neighbouring empty lines are collapsed to at most two empty lines)

Copy link
Contributor

@danbst danbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As NixOS/nix#580 is staled, this is a nice compromise.

@Baughn
Copy link
Contributor Author

Baughn commented Feb 6, 2017

What still needs doing before this can be merged?

@danbst
Copy link
Contributor

danbst commented Feb 6, 2017

perhaps a confirmation from @globin

@globin
Copy link
Member

globin commented Feb 6, 2017

I haven't had the time to test this and won't have until the weekend, but the code looks good so if anyone confirms he has tested this I'd be very happy to merge :)

@Baughn
Copy link
Contributor Author

Baughn commented Feb 6, 2017

I've tested it, of course... guess that doesn't count. :P

@danbst
Copy link
Contributor

danbst commented Feb 7, 2017

I've tested this too and already use on my servers

@globin globin merged commit e362a3d into NixOS:master Feb 7, 2017
@Baughn Baughn deleted the nginx branch February 7, 2017 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants