Giter VIP home page Giter VIP logo

vcl-formatter's Introduction

VCL Formatter

Overview

This tool is a VCL Formatter written in Go. It takes a VCL file as input and formats it by adjusting indentation and merging lines where appropriate. The goal is to make VCL code more readable and maintainable.

Prerequisites

  • Go (Golang) installed on your system.

Usage

To use the VCL Formatter, simply pass the path of your VCL file as an argument:

go run main.go <path-to-your-file.vcl>

How It Works

The program reads a VCL file and processes each line:

  • Trims whitespace and checks for specific VCL structures like if conditions and sub vcl_ blocks.
  • Formats opening braces { by merging them with preceding lines where appropriate.
  • Indents the lines based on the nesting level.
  • Decreases indentation when closing braces } are encountered.

vcl-formatter's People

Contributors

divyendrapatil 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.