Coder Social home page Coder Social logo

konfigured's Introduction

Konfigured

Go Version Badge Go Report Card

Prevent malformed configuration files from being merged to your project. No more breaking builds caused by bad configuration files.

Usage

You can integrate Konfigured to your existing GitHub action workflow by using Namchee/konfigured@<version> in one of your jobs using the YAML syntax.

Below is the example of integrating Konfigured to your workflow in your GitHub action workflow.

on:
  pull_request:

jobs:
  cpr:
    runs-on: ubuntu-latest
    steps:
      - name: Validate configuration file
        uses: Namchee/konfigured@v(version)
        with:
          token: <YOUR_GITHUB_ACCESS_TOKEN_HERE>

Please refer to GitHub workflow syntax for more advanced usage.

Access token is required. Please generate one or use ${{ secrets.GITHUB_TOKEN }} as your access token and the github-actions bot will run the job for you.

Supported File Type

Below are the currently supported configuration files that will be validated by Konfigured:

  • .ini
  • .json
  • .yaml, .yml
  • .toml
  • .hcl

Inputs

You can customize this actions with these following options (fill it on with section):

Name Required? Default Value Description
token true GitHub access token to interact with the GitHub API. It is recommended to store this token with GitHub Secrets. To support automatic close, labeling, and comment report, please grant a write access to the token
newline false false Require all valid configuration file to end with newline.
include false **/*.{json,ini,yaml,yml,toml,hcl} Files to be validated in glob pattern. If this option is omitted, the action will validate all configuration file.

License

This project is licensed under the MIT License

konfigured's People

Contributors

namchee avatar

Stargazers

Roman avatar

Watchers

 avatar  avatar

konfigured's Issues

HCL support

Overview

HashiCorp's HCL is a configuration file format that aims to be a human and machine-friendly. HCL is commonly used in Terraform, which is an automation tool for the cloud.

HCL is natively supported by viper, so enabling the support should be straightforward.

Whitelist

Overview

There is a possibility that all supported files are not related with configuration at all and should not be validated. Moreover, validating too many files may take too much resources.

Please add a kind of whitelist option in which users can select the files they want to validate or they don't want to validate.

Requires new line

Overview

By definition, a text file on Unix consists of a series of line, each of which ends with a newline character \n. Under that definition, a file that is not empty and does not end with a newline is therefore not a text file in Unix.

Although modern text processors doesn't have this particular problem, utilities that are supposed to operate on text files may not cope well with files that don't end with a newline; historical Unix utilities might ignore the text after the last newline, for example. With GNU diff, if one of the files being compared ends with a newline but not the other, it is careful to note that fact. Since diff is line-oriented, it can't indicate this by storing a newline for one of the files but not for the others โ€” the newlines are necessary to indicate where each line in the diff file starts and ends.

Therefore, although it's not a necessity, it's recommended to always end a text file with a newline. Add an option to enable this feature, but set it to inactive by default.

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.