Project

General

Profile

Actions

action #58100

open

HashKeyQuotes: force no quotes for names containing "_"

Added by cfconrad over 4 years ago. Updated over 3 years ago.

Status:
Workable
Priority:
Low
Assignee:
-
Category:
Feature requests
Target version:
Start date:
2019-10-14
Due date:
% Done:

0%

Estimated time:

Description

Motivation

Currently we allow quotes for names containing "". From perl perspective a name containing '' is still a simple identifier and can be used without quotes for hashkey.

From https://perldoc.perl.org/perldata.html :

The => operator is mostly just a more visually distinctive synonym for a comma, but it also arranges
for its left-hand operand to be interpreted as a string if it's a bareword that would be a legal simple
identifier.

So we will end up with a regex like this:

/^[a-zA-Z][0-9a-zA-Z_]*$/

Changing it, produce perlcritic violations, so a cleanup is needed as well.

Acceptance criteria

  • AC1: hash keys containing _ are accepted without surrounding quotes
  • AC2: Adopted tidy rules have been applied to os-autoinst and downstream os-autoinst-distri-opensuse

Suggestions

  • Change existing tidy checks within os-autoinst
  • Ensure os-autoinst code adheres to the new rules
  • Apply the same for os-autoinst-distri-opensuse
Actions

Also available in: Atom PDF