{"id":15064615,"url":"https://github.com/the-undefined/tollgate","last_synced_at":"2025-04-10T12:41:01.117Z","repository":{"id":62559227,"uuid":"120731213","full_name":"the-undefined/tollgate","owner":"the-undefined","description":"Add static analysers into your workflow","archived":false,"fork":false,"pushed_at":"2020-05-12T05:42:08.000Z","size":49,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T11:21:31.578Z","etag":null,"topics":["ruby","ruby-gem","ruby-on-rails","shell-scripts","static-analysis","tollgate","workflow"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/the-undefined.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-08T08:12:38.000Z","updated_at":"2023-08-03T15:23:06.000Z","dependencies_parsed_at":"2022-11-03T11:15:50.190Z","dependency_job_id":null,"html_url":"https://github.com/the-undefined/tollgate","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-undefined%2Ftollgate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-undefined%2Ftollgate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-undefined%2Ftollgate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-undefined%2Ftollgate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/the-undefined","download_url":"https://codeload.github.com/the-undefined/tollgate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217155,"owners_count":21066634,"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","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":["ruby","ruby-gem","ruby-on-rails","shell-scripts","static-analysis","tollgate","workflow"],"created_at":"2024-09-25T00:22:31.116Z","updated_at":"2025-04-10T12:41:01.096Z","avatar_url":"https://github.com/the-undefined.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/the-undefined/tollgate.svg?branch=master)](https://travis-ci.org/the-undefined/tollgate)\n\n# Tollgate\n\nHave you paid your code toll? To get your code into the groomed and uniform metropolis where the static analyser enforcers run the place, then you need to put extra effort and pay the code toll before you are allowed through.\nInvest in a better future!\n\nMaking it easy to add static code analysers to your workflow. Build a list of shell commands to execute and check your code locally and on your CI server.\n\nAll checks need to pass before the tollgate approves the code, if any of the checks fail then a non-zero exit status will be returned, so if using on a CI server then the build will fail.\n\n## Quickstart\n\nAdd the gem to your project:\n\n```rb\ngroup :development, :test do\n  gem \"tollgate\", require: false\nend\n```\n\nDefine a configuration file at `config/tollgate_config.rb` and use the `check` method for any of the command line tools you want to run on your project:\n\n```rb\nTollgate.configure do\n  check \"rubocop\"\n  check \"brakeman\"\n  check \"rspec\"\nend\n```\n\nThen use the `tollgate` command to run your commands:\n\n```sh\n$ tollgate\n# ... output from commands being check\n\nPASS: rubocop\nPASS: brakeman\nFAIL rspec\n```\n\n## Grouping Commands\n\nSometimes you may want several checks to run regardless if one of them has failed, so that you can make related changes before running the tollgate again.\n\nFor instance `rubocop` and `standard` check for Ruby and JavaScript code styles and it makes sense for you to get the output of both of these at the same time.\nWhereas `rubocop` and `rspec` are not related in their information, so by grouping `rubocop` and `standard` you can fix the style changes together before running the tollgate again to get the output from `rspec`:\n\n```rb\nTollgate.configure do\n  group :styles do\n    check \"standard | snazzy\"\n    check \"rubocop\"\n  end\n  \n  check \"rspec\"\nend\n```\n\n```sh\n$ tollgate\n# ... output from checks being run\n\nFAIL: standard | snazzy\nPASS: rubocop\nNOT RUN: rspec\n```\n\nYou do not need to specify a group name if you can't think of one, naming things is hard(!), and you can specify as many groups as you like:\n\n```rb\nTollgate.configure do\n  group do\n    check \"rubocop\"\n    check \"standard | snazzy\"\n  end\n\n  group do\n    check \"brakeman\"\n    check \"rails_best_practices\"\n  end\n\n  check \"rspec\"\n  check \"cucumber\"\nend\n```\nIn the example above, if the first group fails then the second group will not be run, nor will any checks that come later in the list, the output would look like:\n\n```sh\n# ...\n\nFAIL: rubocop\nPASS: standard | snazzy\nNOT RUN: brakeman\nNOT RUN: rails_best_practices\nNOT RUN: rspec\nNOT RUN: cucumber\n\nTollgate failed.\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Tollgate is setup to run on itself under which you can invoke using the `bin/test` script to check for ruby styles and run tests.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb` and tag the commit with the save version, when the build passes on master then Travis will release the new version of the gem to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/the-undefined/tollgate. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## Code of Conduct\n\nEveryone interacting in the Tollgate project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/the-undefined/tollgate/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThis project uses an unlicense, all code is in the public domain, see LICENSE.md for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-undefined%2Ftollgate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe-undefined%2Ftollgate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-undefined%2Ftollgate/lists"}