Skip to content

Commit 2a9fa16

Browse files
bdovazDaniel Li
andauthored
Surfacing warnings during successful runs (#4556)
* Warning Feature quick build * wip * wip * [MegaLinter] Apply linters fixes * wip * wip * wip * wip * wip * wip * wip * wip * wip * [MegaLinter] Apply linters fixes * wip * wip --------- Co-authored-by: Daniel Li <[email protected]> Co-authored-by: bdovaz <[email protected]>
1 parent 5a076e0 commit 2a9fa16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+569
-61
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "stylelint-config-standard",
3+
"rules": {
4+
"comment-empty-line-before": [
5+
"always",
6+
{
7+
"severity": "warning"
8+
}
9+
]
10+
}
11+
}

.automation/test/php/php_bad_2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function takesAnInt(int $i) {
77
return [$i, "hello"];
88
}
99

10-
$data = ["some text", 5];
10+
$data = [ "some text", 5 ];
1111
takesAnInt($data[0]);
1212

1313
$condition = rand(0, 5);

.automation/test/php/php_good_1.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
<?php
22

3+
/**
4+
* PHP version 8
5+
*
6+
* @category Template_Class
7+
* @package Template_Class
8+
* @author Author <[email protected]>
9+
* @license https://opensource.org/licenses/MIT MIT License
10+
* @link http://localhost/
11+
*/
12+
313
echo "Hello World!", PHP_EOL;

.automation/test/php/php_good_2.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
11
<?php
22

33
/**
4-
* @return array<string>
4+
* PHP version 8
5+
*
6+
* @category Template_Class
7+
* @package Template_Class
8+
* @author Author <[email protected]>
9+
* @license https://opensource.org/licenses/MIT MIT License
10+
* @link http://localhost/
11+
*/
12+
13+
/**
14+
* Summary of helloName
15+
* @param string $name test
16+
* @return string[]
517
*/
618
function helloName(string $name): array
719
{
820
return ["hello", $name];
921
}
1022

23+
/**
24+
* Summary of helloMegalinter
25+
* @return void
26+
*/
1127
function helloMegalinter(): void
1228
{
1329
$hello = helloName("MegaLinter");
1430
echo implode(" ", $hello) . PHP_EOL;
1531
}
1632

33+
/**
34+
* Summary of helloOrWorld
35+
* @return void
36+
*/
1737
function helloOrWorld(): void
1838
{
1939
$random = rand(0, 10);

.automation/test/php/phpcs.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer" xsi:noNamespaceSchemaLocation="phpcs.xsd">
3+
<rule ref="PEAR.Commenting">
4+
<type>error</type>
5+
</rule>
6+
<rule ref="PEAR.Functions">
7+
<type>warning</type>
8+
</rule>
9+
<rule ref="PEAR.WhiteSpace">
10+
<type>warning</type>
11+
</rule>
12+
</ruleset>

.automation/test/spell_vale/.vale.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ Packages = Microsoft
66

77
[*]
88
BasedOnStyles = Vale, Microsoft
9+
10+
Vale.Spelling = warning
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
- Correct some broken links in `README` from "Mega-Linter" to "MegaLinter" (#1030)
2-
- Correct some broken links in `README` from "Mega-Linter" to "MegaLinter" (#1030)
3-
- Correct some broken links in `README` from "Mega-Linter" to "MegaLinter" (#1030)
1+
Are you actualy going?
42

5-
This is so advantageous to have an URL !
3+
Are you actualy going?
4+
5+
and and
6+
7+
the the

.automation/test/sql_tsql/.tsqllintrc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"rules": {
3+
"case-sensitive-variables": "warning",
4+
"conditional-begin-end": "error",
5+
"count-star": "error",
6+
"cross-database-transaction": "error",
7+
"data-compression": "error",
8+
"data-type-length": "error",
9+
"delete-where": "error",
10+
"disallow-cursors": "error",
11+
"full-text": "error",
12+
"information-schema": "error",
13+
"keyword-capitalization": "error",
14+
"linked-server": "error",
15+
"multi-table-alias": "error",
16+
"named-constraint": "error",
17+
"non-sargable": "error",
18+
"object-property": "error",
19+
"print-statement": "error",
20+
"schema-qualify": "error",
21+
"select-star": "error",
22+
"semicolon-termination": "error",
23+
"set-ansi": "error",
24+
"set-nocount": "error",
25+
"set-quoted-identifier": "error",
26+
"set-transaction-isolation-level": "error",
27+
"set-variable": "error",
28+
"update-where": "error",
29+
"upper-lower": "error",
30+
"unicode-string": "error"
31+
}
32+
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
SELECT;
2-
GO;
1+
DECLARE @VariableName INT,
2+
@SomeOtherVariable INT;
3+
4+
SELECT @variableName = 1;
5+
SELECT @someOtherVariable = 1;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"Modules":[{"Key":"","Source":"","Dir":"."},{"Key":"module1","Source":"./module","Dir":"module"},{"Key":"module1.module2","Source":"./module","Dir":"module/module"}]}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module "module1" {
2+
source = "./module"
3+
4+
foo = "foo"
5+
bar = "bar"
6+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
variable "foo" {}
2+
variable "bar" {}
3+
variable "baz" {}
4+
5+
module "module2" {
6+
source = "./module"
7+
8+
red = "${var.foo}-${var.bar}"
9+
blue = "blue"
10+
green = "${var.foo}-${var.baz}-${path.module}"
11+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
variable "red" {}
2+
variable "blue" {}
3+
variable "green" {}
4+
variable "yellow" {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
variable "override" {
2+
default = "baz"
3+
}
4+
variable "no_default" {}
5+
variable "unknown" {}
6+
7+
module "test" {
8+
source = "./module1"
9+
10+
override = "${var.override}"
11+
no_default = "${var.no_default}"
12+
unknown = "${var.unknown}"
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
variable "override" {
2+
default = "baz"
3+
}
4+
variable "no_default" {}
5+
variable "unknown" {}
6+
7+
resource "aws_instance" "web" {
8+
ami = "ami-b73b63a0"
9+
instance_type = "t1.2xlarge"
10+
11+
tags {
12+
Name = "HelloWorld"
13+
}
14+
}
15+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
variable "override" {
2+
default = "baz"
3+
}
4+
variable "no_default" {}
5+
variable "unknown" {}
6+
7+
resource "aws_instance" "web" {
8+
ami = "ami-b73b63a0"
9+
instance_type = "t1.2xlarge"
10+
11+
tags {
12+
Name = "HelloWorld"
13+
}
14+
}
15+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"Modules":[{"Key":"root","Source":"./module","Dir":"module"},{"Key":"root.test","Source":"./module1","Dir":"module/module1"},{"Key":"1.root;./module","Source":"./module","Dir":".terraform/modules/07be448a6067a2bba065bff4beea229d"},{"Key":"1.root;./module|test;./module1","Source":"./module1","Dir":".terraform/modules/a8d8930bc3c2ae53bf6e3bbcb3083d7b"},{"Key":"","Source":"","Dir":"."}]}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module "root" {
2+
source = "./module"
3+
4+
override = "foo"
5+
no_default = "bar"
6+
unknown = "${data.aws.ami.id}"
7+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
variable "override" {
2+
default = "baz"
3+
}
4+
variable "no_default" {}
5+
variable "unknown" {}
6+
7+
module "test" {
8+
source = "./module1"
9+
10+
override = "${var.override}"
11+
no_default = "${var.no_default}"
12+
unknown = "${var.unknown}"
13+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
variable "override" {
2+
default = "baz"
3+
}
4+
variable "no_default" {}
5+
variable "unknown" {}
6+
7+
resource "aws_instance" "web" {
8+
ami = "ami-b73b63a0"
9+
instance_type = "t1.2xlarge"
10+
11+
tags {
12+
Name = "HelloWorld"
13+
}
14+
}
15+
16+
resource "aws_instance" "web2" {
17+
ami = "ami-b73b63a1"
18+
instance_type = "t1.2xlarge"
19+
20+
tags {
21+
Name = "HelloWorld2"
22+
}
23+
}
24+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
terraform {
2+
required_version = ">= 1.8.5"
3+
required_providers {
4+
aws = {
5+
source = "hashicorp/aws"
6+
version = ">= 5.55.0" # https://registry.terraform.io/providers/hashicorp/aws/latest
7+
}
8+
}
9+
}
10+
11+
provider "template" {}
12+
13+
provider "aws" {
14+
region = "us-west-2"
15+
}
16+
17+
resource "aws_s3_bucket" "example" {
18+
bucket = "my-tf-test-bucket-${random_id.bucket_suffix.hex}"
19+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
terraform {
2+
required_version = ">= 1.8.5"
3+
required_providers {
4+
aws = {
5+
source = "hashicorp/aws"
6+
version = ">= 5.55.0" # https://registry.terraform.io/providers/hashicorp/aws/latest
7+
}
8+
}
9+
}
10+
11+
provider "aws" {
12+
region = "us-west-2"
13+
}
14+
15+
resource "aws_s3_bucket" "example" {
16+
bucket = "my-tf-test-bucket-${random_id.bucket_suffix.hex}"
17+
}
18+
19+
resource "aws_s3_bucket_versioning" "example" {
20+
bucket = aws_s3_bucket.example.id
21+
versioning_configuration {
22+
status = "Enabled"
23+
}
24+
}
25+
26+
resource "random_id" "bucket_suffix" {
27+
byte_length = 4
28+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
terraform {
2+
required_version = ">= 1.8.5"
3+
required_providers {
4+
azurerm = {
5+
source = "hashicorp/azurerm"
6+
version = ">= 3.109.0" # https://registry.terraform.io/providers/hashicorp/azurerm/latest
7+
}
8+
}
9+
}
10+
11+
provider "azurerm" {
12+
features {}
13+
}
14+
15+
resource "azurerm_resource_group" "example" {
16+
name = "example-resources"
17+
location = "East US"
18+
}
19+
20+
resource "azurerm_storage_account" "example" {
21+
name = "storageacc${random_id.suffix.hex}"
22+
resource_group_name = azurerm_resource_group.example.name
23+
location = azurerm_resource_group.example.location
24+
account_tier = "Standard"
25+
account_replication_type = "GRS"
26+
27+
tags = {
28+
environment = "staging"
29+
}
30+
}
31+
32+
resource "random_id" "suffix" {
33+
byte_length = 8
34+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
terraform {
2+
required_version = ">= 1.8.5"
3+
required_providers {
4+
google = {
5+
source = "hashicorp/google"
6+
version = ">= 5.34.0" # https://registry.terraform.io/providers/hashicorp/google/latest
7+
}
8+
}
9+
}
10+
11+
provider "google" {
12+
project = "my-project-id"
13+
region = "us-central1"
14+
}
15+
16+
resource "google_storage_bucket" "example" {
17+
name = "my-bucket-${random_id.suffix.hex}"
18+
location = "US"
19+
force_destroy = true
20+
21+
uniform_bucket_level_access = true
22+
23+
versioning {
24+
enabled = true
25+
}
26+
}
27+
28+
resource "random_id" "suffix" {
29+
byte_length = 4
30+
}

0 commit comments

Comments
 (0)