Azure / Azure/azure-cli-dev-tools

Linter Feedback

Open
#28 7 comments 0 reactions 1 assignee Claimed by @haroldrandom View on GitHub
enhancement Linter
Dominant language
Python
Stars
91
Forks
134
Avg merge
2h 51m
Merged PRs (30d)
1

Description

My initial feedback:

1. The exclusions file is too verbose. Consider this:
```
network nic ip-config create:
parameters:
private_ip_address_version:
rule_exclusions:
- missing_parameter_help_rule
network nic ip-config update:
parameters:
private_ip_address_version:
rule_exclusions:
- missing_parameter_help_rule
network nsg rule create:
parameters:
access:
rule_exclusions:
- missing_parameter_help_rule
direction:
rule_exclusions:
- missing_parameter_help_rule
network nsg rule update:
parameters:
access:
rule_exclusions:
- missing_parameter_help_rule
direction:
rule_exclusions:
- missing_parameter_help_rule
```
Five lines per exclusion! JSON would be even longer. Consider a custom format, like so:
```
network nic ip-config create:
- private_ip_address_version: missing_parameter_help_rule

network nic ip-config update:
- private_ip_address_version: missing_parameter_help_rule

network nsg rule create:
- access: missing_parameter_help_rule
- direction: missing_parameter_help_rule

network nsg rule update:
- access: missing_parameter_help_rule
- direction: missing_parameter_help_rule,
```

This would be much more readable and doesn't require any keywords.

2. Don't print anything if a rule has no violations. A quiet linter is a happy linter.

3. Consider a `--report` flag which will output violations by module.

4. When a rule violation does occur, print the link or an explanation for how the user is expected to fix it.

5. There is a folder `commandlint` and `cli_linter`. Are both of these needed?

### Environment summary

Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (`az --version`) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)

```
azure-cli (2.0.31)

acr (2.0.22)
acs (2.0.30)
advisor (0.5.0)
appservice (0.1.31)
backup (1.1.0)
batch (3.2.0)
batchai (0.2.0)
billing (0.1.8)
cdn (0.0.14)
cloud (2.0.12)
cognitiveservices (0.1.11)
configure (2.0.14)
consumption (0.3.0)
container (0.1.21)
core (2.0.31)
cosmosdb (0.1.20)
dev-tools (0.1.1)
dla (0.0.18)
dls (0.0.20)
eventgrid (0.1.11)
eventhubs (0.1.2)
extension (0.0.12)
feedback (2.1.0)
find (0.2.8)
interactive (0.3.19)
iot (0.1.18)
keyvault (2.0.21)
lab (0.0.20)
monitor (0.1.5)
network (2.0.28)
nspkg (3.0.2)
profile (2.0.22)
rdbms (0.2.1)
redis (0.2.11)
reservations (0.1.1)
resource (2.0.27)
role (2.0.21)
servicebus (0.1.2)
servicefabric (0.0.11)
sql (2.0.25)
storage (2.0.31)
testsdk (0.1.1)
vm (2.0.30)

Extensions:
alias (0.3.0)
subscription (0.1.0)

Python location 'c:\Users\trpresco\Documents\github\azure-cli\env\Scripts\python.exe'
Extensions directory 'C:\Users\trpresco\.azure\cliextensions'

Python (Windows) 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.