Skip to content

Commit

Permalink
refactor: sync structure project to standard (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
luismayta committed Jul 7, 2024
1 parent cb91883 commit 7cd7713
Show file tree
Hide file tree
Showing 80 changed files with 917 additions and 447 deletions.
2 changes: 1 addition & 1 deletion .chglog/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/hadenlabs/terraform-module-template
repository_url: https://github.com/hadenlabs/terraform-cloudflare
options:
commits:
filters:
Expand Down
12 changes: 6 additions & 6 deletions .ci/config/.terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
formatter: 'markdown' # this is required
version: ''
formatter: "markdown" # this is required
version: ""

header-from: main.tf
footer-from: ''
footer-from: ""

recursive:
enabled: false
Expand All @@ -12,10 +12,10 @@ sections:
hide: []
show: []

content: ''
content: ""

output:
file: 'docs/include/terraform.md'
file: "docs/include/terraform.md"
mode: replace
template: |-
<!-- markdown-link-check-disable -->
Expand All @@ -26,7 +26,7 @@ output:
output-values:
enabled: false
from: ''
from: ""

sort:
enabled: true
Expand Down
File renamed without changes.
30 changes: 15 additions & 15 deletions .ci/linters/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
module.exports = {
parser: '@typescript-eslint/parser',
parser: "@typescript-eslint/parser",
env: {
node: true,
es2021: true
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module' // Allows for the use of imports
sourceType: "module" // Allows for the use of imports
},
extends: [
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:import/warnings'
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"plugin:import/warnings"
],
plugins: ['@typescript-eslint'],
plugins: ["@typescript-eslint"],
rules: {
'@typescript-eslint/semicolon': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/naming-convention': 'warn',
'@typescript-eslint/semi': 'off',
'no-throw-literal': 'warn',
curly: 'warn',
eqeqeq: 'warn',
semi: 'off'
"@typescript-eslint/semicolon": "off",
"@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "off",
"no-throw-literal": "warn",
curly: "warn",
eqeqeq: "warn",
semi: "off"
},
ignorePatterns: ['**/*.d.ts']
ignorePatterns: ["**/*.d.ts"]
}
31 changes: 8 additions & 23 deletions .ci/linters/.gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,28 +161,9 @@ title = "gitleaks config"
regexes = [
'''host=HOST''',
'''--private-key={{.PRIVATE_KEY_FILE}}''',
'''PASSWORD=XXXXXX''',
]

[[rules]]
description = "Email"
regex = '''[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}'''
tags = ["email"]
[rules.allowlist]
description = "ignore emails"
regexes = [
'''[a-zA-Z0-9._%+-][email protected]''',
'''[a-zA-Z0-9._%+-][email protected]''',
'''[email protected]''',
'''[email protected]''',
'''[email protected]''',
'''[email protected]''',
'''[email protected]''',
'''[email protected]''',
'''[email protected]''',
'''[email protected]''',
'''[email protected]''',
'''[email protected]''',
]

[[rules]]
description = "High Entropy"
Expand Down Expand Up @@ -262,9 +243,11 @@ title = "gitleaks config"
[whitelist]
description = "image and html allowlists"
paths = [
'''^vendor/(.*?)$''',
'''^node_modules/(.*?)$''',
'''^test/fixtures/keys/(.*?)$''',
'''^vendor/''',
'''^bower_components/''',
'''^public/''',
'''^node_modules/''',
'''^theme/''',
]

files = [
Expand All @@ -276,3 +259,5 @@ title = "gitleaks config"
'''^sonar-project.properties$''',
'''^test/fixtures/keys/.*-test.*$''',
]

commits = []
4 changes: 4 additions & 0 deletions .ci/linters/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ linters:
- unconvert
- misspell
- nakedret
- unused

presets:
- bugs
Expand All @@ -121,6 +122,9 @@ linters:
- sqlclosecheck
- structcheck
- unparam
- deadcode
- varcheck
- asasalint

# Drives todos nuts
- godox
Expand Down
18 changes: 9 additions & 9 deletions .ci/linters/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: terraform-module-template
project_name: terraform-cloudflare
env:
- GO111MODULE=on
- REPO=github.com/hadenlabs/terraform-module-template
- REPO=github.com/hadenlabs/terraform-cloudflare
before:
hooks:
- go mod download
Expand Down Expand Up @@ -39,7 +39,7 @@ archives:
builds:
- default
wrap_in_directory: true
name_template: '{{.ProjectName}}-{{.Os}}-{{.Arch}}'
name_template: "{{.ProjectName}}-{{.Os}}-{{.Arch}}"
format: tar.gz
format_overrides:
- goos: windows
Expand All @@ -52,22 +52,22 @@ archives:
- systemd/*
# https://goreleaser.com/snapshots/
snapshot:
name_template: 'dev@{{.ShortCommit}}'
name_template: "dev@{{.ShortCommit}}"

# https://goreleaser.com/checksum/
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
algorithm: sha256
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- "^docs:"
- "^test:"
release:
github:
owner: hadenlabs
name: terraform-module-template
name: terraform-cloudflare
draft: true
prerelease: auto
name_template: '{{.ProjectName}}-v{{.Version}}-{{.ShortCommit}}-{{.Date}}'
name_template: "{{.ProjectName}}-v{{.Version}}-{{.ShortCommit}}-{{.Date}}"
8 changes: 4 additions & 4 deletions .ci/linters/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const escape = require('shell-quote').quote
const escape = require("shell-quote").quote

module.exports = {
'*.{ts,tsx,js,json,css}': (filenames) => [
"*.{ts,tsx,js,json,css}": (filenames) => [
...filenames.map((filename) => `prettier --check "${escape([filename])}"`),
...filenames.map((filename) => `git add "${filename}"`)
],
'*.{ts,tsx,js,jsx}': ['eslint'],
'*.{ts,tsx,css}': ['stylelint']
"*.{ts,tsx,js,jsx}": ["eslint"],
"*.{ts,tsx,css}": ["stylelint"]
}
2 changes: 1 addition & 1 deletion .ci/linters/.tflint.hcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugin "aws" {
enabled = true
version = "0.8.0"
version = "0.27.0"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}
rule "terraform_deprecated_index" {
Expand Down
5 changes: 1 addition & 4 deletions .ci/linters/markdown-link-config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"baseUrl": "https://github.com/hadenlabs/terraform-module-template",
"baseUrl": "https://github.com/hadenlabs/terraform-cloudflare",
"ignorePatterns": [
{
"pattern": "^https://hadenlabs.com"
},
{
"pattern": "^https://github.com/hadenlabs/terraform-module-template/compare"
}
],
"replacementPatterns": [
Expand Down
55 changes: 31 additions & 24 deletions .ci/linters/prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,64 +1,71 @@
module.exports = {
arrowParens: 'always',
arrowParens: "always",
printWidth: 120,
proseWrap: 'preserve',
proseWrap: "preserve",
semi: false,
singleQuote: true,
singleQuote: false,
tabWidth: 2,
trailingComma: 'none',
trailingComma: "none",
overrides: [
{
files: '{*.js?(x),*.ts?(x),*.y?(a)ml,.*.y?(a)ml,*.md,.prettierrc,.stylelintrc,.babelrc}',
files: "{*.js?(x),*.ts?(x),*.y?(a)ml,.*.y?(a)ml,*.md,.prettierrc,.stylelintrc,.babelrc}",
options: {
arrowParens: 'always',
arrowParens: "always",
printWidth: 100,
semi: false,
singleQuote: true,
quoteProps: 'as-needed',
quoteProps: "as-needed",
tabWidth: 2,
trailingComma: 'none'
trailingComma: "none"
}
},
{
files: '{*.json,.*.json,**/.vscode/*.json,**/tsconfig.json,**/tsconfig.*.json}',
files: "{*.lua}",
options: {
parser: 'json',
printWidth: 100,
tabWidth: 2,
quoteProps: "preserve"
}
},

{
files: "{*.json,.*.json,**/.vscode/*.json,**/tsconfig.json,**/tsconfig.*.json}",
options: {
parser: "json",
tabWidth: 2,
quoteProps: 'preserve',
singleQuote: false
quoteProps: "preserve"
}
},
{
files: '*.md',
files: "*.md",
options: {
parser: 'markdown',
parser: "markdown",
printWidth: 120,
proseWrap: 'never',
proseWrap: "never",
semi: false,
trailingComma: 'none'
trailingComma: "none"
}
},
{
files: '*.mdx',
files: "*.mdx",
options: {
printWidth: 120,
proseWrap: 'never',
proseWrap: "never",
semi: false,
trailingComma: 'none'
trailingComma: "none"
}
},
{
files: '*.{sass,scss}',
files: "*.{sass,scss}",
options: {
parser: 'scss'
parser: "scss"
}
},
{
files: '*.less',
files: "*.less",
options: {
tabWidth: 4,
printWidth: 80,
parser: 'less'
parser: "less"
}
}
]
Expand Down
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.*
!.coveragerc
!.env
!.pylintrc
.venv
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ trim_trailing_whitespace = true
[*.{el}]
insert_final_newline = false

[*.{el,md,mdx,yml,yaml,js,json,toml,ts,tsx,hcl,tf,graphql,hbs,sh}]
[*.{el,md,mdx,yml,yaml,js,json,toml,ts,tsx,hcl,tf,graphql,hbs,sh,lua}]
indent_style = space
indent_size = 2

[*.{lua}]
indent_style = space
indent_size = 2

Expand Down
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# **NOTE**: please check the following document docs/env-vars.md
APP_NAME=terraform-module-template
APP_NAME=terraform-cloudflare
SONAR_URL=
SONAR_TOKEN=
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Briefly describe the issue you are experiencing (or the feature you want to see

- OS: {Please write here}
- Python version: {Please write here}
- Python Facebook Chatbot version : {Please write here}

## Details

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Bug report
name: 🐛 Bug report
about: Create a report to help us improve
labels: type/bug
---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Feature request
name: 🚀 Feature request
about: Suggest an idea for this project
labels: type/enhancement
---
Expand Down
Loading

0 comments on commit 7cd7713

Please sign in to comment.