GithubHelp home page GithubHelp logo

icycandle / nginx-config-formatter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from slomkowski/nginx-config-formatter

0.0 1.0 0.0 33 KB

nginx config file formatter/beautifier written in Python.

License: Apache License 2.0

Python 100.00%

nginx-config-formatter's Introduction

nginx config file formatter

This Python script formats nginx configuration files in consistent way, described below:

  • all lines are indented in uniform manner, with 4 spaces per level
  • neighbouring empty lines are collapsed to at most two empty lines
  • curly braces placement follows Java convention
  • whitespaces are collapsed, except in comments an quotation marks
  • whitespaces in variable designators are removed: ${ my_variable } is collapsed to ${my_variable}

Installation

Python 3.2 or later is needed to run this program. The simplest form of installation would be copying nginxfmt.py to your scripts directory.

You can also clone the repository and symlink the executable:

cd
git clone https://github.com/1connect/nginx-config-formatter.git
ln -s ~/nginx-config-formatter/nginxfmt.py ~/bin/nginxfmt.py

Usage

usage: nginxfmt.py [-h] [-v] [-b] config_files [config_files ...]

Script formats nginx configuration file.

positional arguments:
  config_files          configuration files to format

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         show formatted file names
  -b, --backup-original
                        backup original config file

Credits

Copyright 2016 Michał Słomkowski @ 1CONNECT. License: Apache 2.0.

nginx-config-formatter's People

Contributors

rickiel avatar slomkowski avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.