0.01
No release in over 3 years
Low commit activity in last 3 years
Provides Ruby, Rails, and RSpec rubocop rules. Also provides helpers for properly formatting CI output.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Thanx Style Guide

🔏 Style Guide & Linting Rules


CircleCI

Owners

For significant changes, pull requests should get approval from at least one of the following before being merged.

  • @drn
  • @marcferna
  • millenniumiguana

Release

To release changes to the Rubygem that is packaged within this project, first update the version constant, the Gemfile.lock, and create a git tag. Once complete, changes can be released to rubygems.org via the following commands:

cd ruby
./deploy

The eng@thanx.com credentials in 1Password in the Eng vault can be used if prompted.

General Style

  • trailing whitespace should be pruned
  • newlines should exist at the end of every file
  • line lengths
    • 80 characters default
    • 50 characters for git commit summaries
    • 72 characters for git commit explanatory text
  • 2 character soft tabs for indentation
  • tabs should always be translated to spaces
  • a single indent should be exactly 2 spaces

Commit Messages

  • TA-0000. Capitalized, short (<= 50 characters).
  • Prefixed with a corresponding JIRA ticket number.
  • Summary should be less than 50 characters or less.
  • More detailed explanatory text following if necessary, wrapped at 72 characters. Explanatory text should be separated from the summary with a line break.
  • Tags indicate that an action is necessary after the commit is deployed or checked out locally. We have the following conventions.
  • More on Git Commit Messages

Ruby Linting

All ruby linting is performed via Rubocop.

To add Thanx rubocop rules to any Ruby project, install the thanx-style rubygem.

Install

# Gemfile
gem 'thanx-style'

$ bundle

Configure

# .rubocop.yml
inherit_gem:
  thanx-style: rubocop.yml

Lint

$ rubocop

Circle CI

Environment

$DANGER_GITHUB_API_TOKEN

Configuration

# .circleci/config.yml
lint:
  docker:
    - ...
  steps:
    - ...
    - run:
        name: Lint
        command: bundle exec thanx-rubocop
    - store_test_results:
        path: test-results
    - run:
        name: Danger Report Rubocop Results
        command: bundle exec thanx-report-rubocop
        when: always

test:
  docker:
    - ...
  steps:
    - ...
    - run:
        name: Tests
        command: bundle exec thanx-rspec
    - store_test_results:
        path: test-results
    - store_artifacts:
        path: coverage
    - run:
        name: Danger Report RSpec Results
        command: bundle exec thanx-report-rspec
        when: always

Resources