Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rubocop): move LineLength cop from Metrics to Layout #129

Merged
merged 1 commit into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# vim: ft=yaml
---
# General overrides used across formulas in the org
Metrics/LineLength:
Layout/LineLength:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
Max: 88
Expand Down
6 changes: 3 additions & 3 deletions ssf/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ ssf_node_anchors:
# An alternative method could be to use:
# `git describe --abbrev=0 --tags`
# yamllint disable rule:line-length rule:quoted-strings
title: "ci(kitchen+travis+inspec): fix '`'amazonlinux-2-py3'`' [skip ci]"
body: '* Semi-automated using https://github.com/myii/ssf-formula/pull/128'
title: "chore(rubocop): move '`'LineLength'`' cop from '`'Metrics'`' to '`'Layout'`' [skip ci]"
body: '* Automated using https://github.com/myii/ssf-formula/pull/129'
# yamllint enable rule:line-length rule:quoted-strings
github:
owner: 'saltstack-formulas'
Expand Down Expand Up @@ -152,7 +152,7 @@ ssf_node_anchors:
rubocop:
AllCops: {}
Cops:
Metrics/LineLength:
Layout/LineLength:
Bugbear: *line_length_bugbear
Default: *line_length_default
Max: *line_length_bugbear
Expand Down
14 changes: 7 additions & 7 deletions ssf/files/default/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# vim: ft=yaml
---
# General overrides used across formulas in the org
{%- set MLL = 'Metrics/LineLength' %}
{{ MLL }}:
{%- set rbcp_MLL = rubocop.Cops.get(MLL) %}
{%- if rbcp_MLL.Max == rbcp_MLL.Bugbear %}
# Increase from default of `{{ rbcp_MLL.Default }}`
{%- set LLL = 'Layout/LineLength' %}
{{ LLL }}:
{%- set rbcp_LLL = rubocop.Cops.get(LLL) %}
{%- if rbcp_LLL.Max == rbcp_LLL.Bugbear %}
# Increase from default of `{{ rbcp_LLL.Default }}`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
{%- endif %}
Max: {{ rbcp_MLL.Max }}
Max: {{ rbcp_LLL.Max }}

{%- if rubocop.AllCops %}

Expand All @@ -30,7 +30,7 @@ AllCops:
{%- if semrel_formula == 'template' %}
# <REMOVEME
{%- endif %}
{%- for cop, config in rubocop.Cops.items() if cop not in [MLL] %}
{%- for cop, config in rubocop.Cops.items() if cop not in [LLL] %}
{{ cop }}:
{#- This is purposefully simplistic for the time being,
until (if ever) more advanced configuration is necessary #}
Expand Down