{"id":22289419,"url":"https://github.com/tf/env_lint","last_synced_at":"2025-07-24T22:04:40.563Z","repository":{"id":56844647,"uuid":"16798782","full_name":"tf/env_lint","owner":"tf","description":"Check environment variables accoring to a .env.example file","archived":false,"fork":false,"pushed_at":"2017-03-03T12:09:37.000Z","size":33,"stargazers_count":28,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-28T14:17:56.510Z","etag":null,"topics":["12-factor","dotenv"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-13T09:58:03.000Z","updated_at":"2024-12-24T06:00:48.000Z","dependencies_parsed_at":"2022-09-09T01:00:07.673Z","dependency_job_id":null,"html_url":"https://github.com/tf/env_lint","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/tf/env_lint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf%2Fenv_lint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf%2Fenv_lint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf%2Fenv_lint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf%2Fenv_lint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tf","download_url":"https://codeload.github.com/tf/env_lint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf%2Fenv_lint/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266909392,"owners_count":24004659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["12-factor","dotenv"],"created_at":"2024-12-03T17:09:07.248Z","updated_at":"2025-07-24T22:04:40.507Z","avatar_url":"https://github.com/tf.png","language":"Ruby","readme":"# Env Lint\n\n[![Gem Version](https://badge.fury.io/rb/env_lint.png)](http://badge.fury.io/rb/env_lint)\n[![Build Status](https://travis-ci.org/tf/env_lint.svg?branch=master)](https://travis-ci.org/tf/env_lint)\n\nCheck configuration of [12 factor apps](http://12factor.net/config)\naccording to to a `.env.example` file.\n\n* Avoid spelling errors in variable names in your code or on the\n  command line\n* Ensure all relevant environment variables are described in the\n  `.env.example` file.\n* Ensure all required environment variables are configured before\n  deploying a new version of an app\n* Ease setting up a new development machine\n* Plays well with [dotenv](https://github.com/bkeepers/dotenv)\n\nIf you'd rather read some prose, there's also a\n[blog post](http://stderr.timfischbach.de/2014/02/20/environment-liniting-for-12-factor-apps.html)\nexplaining why we got started with env_lint.\n\n## Status\n\nUsed in production. Following semantic versioning. Capistrano tasks\nonly tested with [recap](https://github.com/tomafro/recap) capistrano\ntasks.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'env_lint'\n\n## Usage\n\nDefine a `.env.example` file:\n\n    # Explain each variable in comments like this one\n    APP_NAME=my_app\n\n    # Comments are also recognized if they span multiple\n    # lines\n    FEATURE=true\n\n    # Optional variables\n    # OPTIONAL_VAR=\"set me if you like\"\n\n### Rake Task\n\nRequire it in your `Rakefile`:\n\n    require 'env_lint/tasks'\n\nNow you can check your environment:\n\n    $ rake env:lint\n    =\u003e Complains if non optional variables are missing\n\nIf special steps are needed to setup your env, you can define a\n`env:load` task. For example to integrate with\n[Dotenv](https://github.com/bkeepers/dotenv):\n\n    require 'env_lint/tasks'\n    require 'dotenv'\n\n    namespace :env do\n      task :load do\n        Dotenv.load\n      end\n    end\n\n### Capistrano Task\n\nRequire it in your `Capfile`:\n\n    require 'env_lint/capistrano'\n\nNow you can check your servers:\n\n    $ cap env:lint\n    =\u003e Complains if non optional variables are missing\n\nYou might want to lint the environment automatically before each\ndeploy:\n\n    before 'deploy', 'env:lint'\n\nBy default, env_lint tries to run `export` as your recap application\nuser. The probe command can be configured:\n\n    set(:env_probe_command, \"su - deploy -c 'export'\")\n\nLint variable names before setting them:\n\n    before 'env:set', 'env:lint_args'\n\n    $ cap env:set APP_NAME=myapp\n    =\u003e Complains if APP_NAME is not defined\n\n### Lint at Runtime\n\nAccess ENV through a `LintedEnv`:\n\n    require 'env_lint'\n\n    class MyApp\n      LINTED_ENV = EnvLint::LintedEnv.from_file('.env.example')\n\n      def self.env\n        LINTED_ENV\n      end\n    end\n\nAccessing env variables:\n\n    # Ensures APP_NAME is defined in .env.example\n    MyApp.env.fetch(:app_name, 'App name')\n\n    # Ensures APP_NAME is non optional in .env.example\n    MyApp.env.fetch(:app_name)\n\n## Alternatives\n\n* [ENV_BANG](https://github.com/jcamenisch/ENV_BANG) - Offers a ruby\n  DSL. Comes with type conversion features. Does not include tasks to\n  check environment variables without running the app.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftf%2Fenv_lint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftf%2Fenv_lint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftf%2Fenv_lint/lists"}