├── .nvmrc
├── .python-version
├── docs
├── faq.md
├── support.md
├── index.md
├── usage.md
├── disclaimer.md
├── authors.md
├── testing.md
├── troubleshooting.md
├── functions.md
├── components.md
├── examples
│ └── common.md
├── env-vars.md
├── include
│ └── installation
│ │ ├── antigen.md
│ │ ├── oh-my-zsh.md
│ │ └── antibody.md
├── roadmap.md
├── releasing.md
├── commands.md
├── code_of_conduct.md
├── contribute
│ └── github-flow.md
└── contributing.md
├── .terraform-version
├── config
├── linux.zsh
├── osx.zsh
├── colima.zsh
├── docker.zsh
├── orbstack.zsh
├── podman.zsh
├── lima.zsh
├── base.zsh
└── main.zsh
├── pkg
├── linux.zsh
├── osx.zsh
├── helper.zsh
├── alias.zsh
├── main.zsh
└── base.zsh
├── .ci
├── config
│ ├── mockery.yaml
│ └── .terraform-docs.yml
└── linters
│ ├── .codespell-ignores
│ ├── .commitlintrc.json
│ ├── .eslintignore
│ ├── .yamllint
│ ├── .ansible-lint
│ ├── checkov.yml
│ ├── .lintstagedrc.js
│ ├── .prettierignore
│ ├── .stylintrc
│ ├── markdown-link-config.json
│ ├── yamllint.config.yaml
│ ├── .hadolint.yaml
│ ├── .eslintrc.js
│ ├── .tflint.hcl
│ ├── prettier.config.cjs
│ ├── .goreleaser.yml
│ ├── .golangci.yml
│ ├── .gitleaks.toml
│ └── .pylintrc
├── internal
├── helper.zsh
├── osx.zsh
├── linux.zsh
├── docker.zsh
├── orbstack.zsh
├── colima.zsh
├── podman.zsh
├── lima.zsh
├── main.zsh
└── base.zsh
├── .dockerignore
├── provision
├── diagrams
│ ├── docs
│ │ └── diagrams
│ │ │ ├── logo.plantuml
│ │ │ └── example.plantuml
│ └── Taskfile.yml
├── generators
│ └── README.yaml
└── templates
│ └── README.tpl.md
├── .env.example
├── .github
├── renovate.json
├── semantic.yml
├── ISSUE_TEMPLATE
│ ├── general_issue.md
│ ├── feature_request.md
│ ├── support_question.md
│ └── bug_report.md
├── FUNDING.yml
├── ISSUE_TEMPLATE.md
├── workflows
│ ├── lint.yml
│ ├── sonarqube.yml
│ ├── confluence.yml
│ └── release.yml
├── PULL_REQUEST_TEMPLATE.md
└── stale.yml
├── sonar-project.properties
├── mkdocs.yml
├── zsh-docker.zsh
├── SECURITY.md
├── .chglog
├── CHANGELOG.tpl.md
└── config.yml
├── .editorconfig
├── .goji.json
├── .pre-commit-config.yaml
├── pyproject.toml
├── README.md
├── Taskfile.yml
└── LICENSE
/.nvmrc:
--------------------------------------------------------------------------------
1 | v20.9.0
2 |
--------------------------------------------------------------------------------
/.python-version:
--------------------------------------------------------------------------------
1 | 3.11.5
--------------------------------------------------------------------------------
/docs/faq.md:
--------------------------------------------------------------------------------
1 | # Faq
2 |
--------------------------------------------------------------------------------
/.terraform-version:
--------------------------------------------------------------------------------
1 | 1.11.4
2 |
--------------------------------------------------------------------------------
/docs/support.md:
--------------------------------------------------------------------------------
1 | # Support & Contact
2 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | # Welcome to zsh-docker documentation
2 |
--------------------------------------------------------------------------------
/config/linux.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
--------------------------------------------------------------------------------
/pkg/linux.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
--------------------------------------------------------------------------------
/pkg/osx.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
--------------------------------------------------------------------------------
/.ci/config/mockery.yaml:
--------------------------------------------------------------------------------
1 | with-expecter: false
2 | outpkg: "mocks"
3 |
--------------------------------------------------------------------------------
/.ci/linters/.codespell-ignores:
--------------------------------------------------------------------------------
1 | cas
2 | wit
3 | NotIn
4 | notin
5 |
--------------------------------------------------------------------------------
/config/osx.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
--------------------------------------------------------------------------------
/internal/helper.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
--------------------------------------------------------------------------------
/internal/osx.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
--------------------------------------------------------------------------------
/pkg/helper.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | .*
2 | !.coveragerc
3 | !.env
4 | !.pylintrc
5 | .venv
6 |
--------------------------------------------------------------------------------
/internal/linux.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
--------------------------------------------------------------------------------
/provision/diagrams/docs/diagrams/logo.plantuml:
--------------------------------------------------------------------------------
1 | @startuml
2 | @enduml
3 |
--------------------------------------------------------------------------------
/provision/diagrams/docs/diagrams/example.plantuml:
--------------------------------------------------------------------------------
1 | @startuml
2 | @enduml
3 |
--------------------------------------------------------------------------------
/docs/usage.md:
--------------------------------------------------------------------------------
1 | # 🚀 How to use this project
2 |
3 | ```bash
4 | task setup
5 | ```
6 |
--------------------------------------------------------------------------------
/.ci/linters/.commitlintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["@hadenlabs/commitlint-config"]
3 | }
4 |
--------------------------------------------------------------------------------
/docs/disclaimer.md:
--------------------------------------------------------------------------------
1 | **NOTE**: this document is generated [mark](https://github.com/kovetskiy/mark), do not edit manually.
2 |
--------------------------------------------------------------------------------
/config/colima.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function container::core {
5 | alias docker='docker'
6 | }
--------------------------------------------------------------------------------
/config/docker.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function container::core {
5 | alias docker=docker
6 | }
--------------------------------------------------------------------------------
/config/orbstack.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function container::core {
5 | alias docker=docker
6 | }
--------------------------------------------------------------------------------
/config/podman.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function container::core {
5 | alias docker=podman
6 | }
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | # **NOTE**: please check the following document docs/env-vars.md
2 | APP_NAME=zsh-docker
3 | SONAR_URL=
4 | SONAR_TOKEN=
5 |
--------------------------------------------------------------------------------
/docs/authors.md:
--------------------------------------------------------------------------------
1 | # Authors
2 |
3 | ## Leads
4 |
5 | - Luis Mayta [@luismayta](https://github.com/luismayta)
6 |
7 | ## Contributors (chronological)
8 |
--------------------------------------------------------------------------------
/config/lima.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function container::core {
5 | alias docker='limactl shell default nerdctl'
6 | }
--------------------------------------------------------------------------------
/docs/testing.md:
--------------------------------------------------------------------------------
1 | # Testing
2 |
3 | ## Running all tests
4 |
5 | ```bash
6 | task test
7 | ```
8 |
9 | ## Running tests
10 |
11 | ## Running tests Syntax
12 |
--------------------------------------------------------------------------------
/.ci/linters/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | dist/
3 | build/
4 | out/
5 | .serverless/
6 | .serverless_nextjs/
7 | .next/
8 | storybook-static/
9 | __snapshots__/
10 |
--------------------------------------------------------------------------------
/.ci/linters/.yamllint:
--------------------------------------------------------------------------------
1 | ---
2 | extends: default
3 |
4 | rules:
5 | line-length:
6 | max: 300
7 | level: warning
8 |
9 | comments-indentation: disable
10 |
--------------------------------------------------------------------------------
/docs/troubleshooting.md:
--------------------------------------------------------------------------------
1 | # Troubleshooting
2 |
3 | ## Environment
4 |
5 | ### Wrong pre-commit with poetry
6 |
7 | Execute the next:
8 |
9 | ```{.bash}
10 | task environment
11 | ```
12 |
--------------------------------------------------------------------------------
/.github/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["github>hadenlabs/renovate-config"],
3 | "packageRules": [
4 | {
5 | "matchDepTypes": ["devDependencies"],
6 | "automerge": true
7 | }
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/docs/functions.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | ## Functions
9 |
--------------------------------------------------------------------------------
/.ci/linters/.ansible-lint:
--------------------------------------------------------------------------------
1 | warn_list:
2 | - '204' # Lines should be less than 160 characters
3 | - '701' # meta/main.yml should contain relevant info
4 | skip_list:
5 | - '106' # Role name must match ^[a-z][a-z0-9_]+$ pattern
6 | - 'yaml'
7 | - 'role-name'
8 |
--------------------------------------------------------------------------------
/.ci/linters/checkov.yml:
--------------------------------------------------------------------------------
1 | download-external-modules: true
2 | evaluate-variables: true
3 | external-modules-download-path: .external_modules
4 | framework:
5 | - all
6 | no-guide: true
7 | output: cli
8 | quiet: true
9 | skip-fixes: true
10 | skip-suppressions: true
11 | soft-fail: true
12 |
--------------------------------------------------------------------------------
/.github/semantic.yml:
--------------------------------------------------------------------------------
1 | # Configuration for Semantic Pull Requests
2 | titleOnly: true
3 |
4 | types:
5 | - feat
6 | - fix
7 | - docs
8 | - style
9 | - refactor
10 | - perf
11 | - test
12 | - build
13 | - ci
14 | - chore
15 | - revert
16 | - release
17 | - hotfix
18 |
--------------------------------------------------------------------------------
/docs/components.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | # Components
11 |
--------------------------------------------------------------------------------
/docs/examples/common.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | ## Common
9 |
10 | ### Install Dependencies
11 |
12 | ```bash
13 | task setup
14 | ```
15 |
--------------------------------------------------------------------------------
/sonar-project.properties:
--------------------------------------------------------------------------------
1 | sonar.organization=hadenlabs
2 | sonar.projectKey=hadenlabs:zsh-docker
3 | sonar.projectName=zsh-docker
4 | sonar.projectVersion=0.0.0
5 | sonar.projectBaseDir=./
6 | sonar.sources=./
7 | sonar.coverage.dtdVerification=false
8 | sonar.coverage.exclusions=provision
9 | sonar.sourceEncoding=UTF-8
10 |
--------------------------------------------------------------------------------
/docs/env-vars.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | ---
11 |
12 | ## Env Vars
13 |
14 | ### Application
15 |
--------------------------------------------------------------------------------
/pkg/alias.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | alias d='docker'
5 |
6 | # Images
7 |
8 | alias di='docker images'
9 |
10 | alias drmi='docker rmi'
11 |
12 | alias dbu='docker build'
13 |
14 | alias dps='docker ps'
15 |
16 | alias drm='docker rm'
17 |
18 | alias dexec='docker exec'
19 |
20 | alias dlog='docker logs'
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/general_issue.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 📋 General issue
3 | about: Good for questions, clarifications etc
4 | labels: type/general-report
5 | ---
6 |
7 | ## What is the issue?
8 |
9 | ## Suggestion(s)/solution(s) [Optional]
10 |
11 | ## Checklist (after created issue)
12 |
13 | - [ ] Added label(s)
14 | - [ ] Added to project
15 | - [ ] Added to milestone
16 |
--------------------------------------------------------------------------------
/.ci/linters/.lintstagedrc.js:
--------------------------------------------------------------------------------
1 | const escape = require("shell-quote").quote
2 |
3 | module.exports = {
4 | "*.{ts,tsx,js,json,css}": (filenames) => [
5 | ...filenames.map((filename) => `prettier --check "${escape([filename])}"`),
6 | ...filenames.map((filename) => `git add "${filename}"`)
7 | ],
8 | "*.{ts,tsx,js,jsx}": ["eslint"],
9 | "*.{ts,tsx,css}": ["stylelint"]
10 | }
11 |
--------------------------------------------------------------------------------
/internal/docker.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function container::internal::container::install {
5 | if core::exists docker; then
6 | return
7 | fi
8 | message_info "Installing ${ZSH_DOCKER_PACKAGE_NAME}"
9 | core::install docker
10 | message_success "Installed ${ZSH_DOCKER_PACKAGE_NAME}"
11 | }
12 |
13 | function container::internal::container::load {
14 | return
15 | }
--------------------------------------------------------------------------------
/internal/orbstack.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function container::internal::container::install {
5 | if core::exists docker; then
6 | return
7 | fi
8 | message_info "Installing ${ZSH_DOCKER_PACKAGE_NAME}"
9 | core::install orbstack
10 | message_success "Installed ${ZSH_DOCKER_PACKAGE_NAME}"
11 | }
12 |
13 | function container::internal::container::load {
14 | return
15 | }
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 🚀 Feature request
3 | about: Suggest an idea for this project
4 | labels: type/enhancement
5 | ---
6 |
7 | ## Feature description
8 |
9 | ## Why is it needed?
10 |
11 | ## Suggestion(s)/solution(s) [Optional]
12 |
13 | ## Definition of done
14 |
15 | ## Checklist (after created issue)
16 |
17 | - [ ] Added label(s)
18 | - [ ] Added to project
19 | - [ ] Added to milestone
20 |
--------------------------------------------------------------------------------
/.ci/linters/.prettierignore:
--------------------------------------------------------------------------------
1 | .next
2 | .serverless
3 | .serverless_nextjs
4 | node_modules
5 | dist
6 | build
7 | package.json
8 | package-lock.json
9 | coverage
10 | .mypy_cache/
11 | .build
12 | .terraform
13 | .ci/linters/.cache/*
14 | .cache/*
15 | terraform.md
16 | *.tpl.md
17 | *.enc.yaml
18 | vendor
19 | public
20 | staticfiles
21 | out
22 | .vscode-test
23 | .cache
24 | .venv
25 | .task
26 | contrib/
27 | site/
28 | .external_modules
29 | CHANGELOG.md
30 | charts
31 |
--------------------------------------------------------------------------------
/.ci/linters/.stylintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "stylelint-config-standard",
3 | "rules": {
4 | "color-hex-length": "long",
5 | "declaration-colon-newline-after": null,
6 | "function-calc-no-invalid": null,
7 | "indentation": "tab",
8 | "no-descending-specificity": null,
9 | "no-empty-source": null,
10 | "no-eol-whitespace": null,
11 | "number-leading-zero": "always",
12 | "selector-list-comma-newline-after": null,
13 | "selector-pseudo-element-colon-notation": "double"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/mkdocs.yml:
--------------------------------------------------------------------------------
1 | site_name: zsh-docker Documentation
2 | theme: "material"
3 | markdown_extensions:
4 | - toc:
5 | permalink: True
6 | - admonition
7 | - smarty
8 | - wikilinks
9 | - codehilite:
10 | linenums: True
11 | extra:
12 | palette:
13 | primary: "#087da1"
14 | accent: "#00a889"
15 | font:
16 | text: "Source Sans Pro"
17 |
18 | repo_name: "hadenlabs/zsh-docker"
19 | repo_url: "https://github.com/hadenlabs/zsh-docker"
20 | copyright: 'Copyright © 2021 hadenlabs'
21 |
22 | google_analytics:
23 | - ""
24 | - "auto"
25 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/support_question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Support Question
3 | about: I have a question and require assistance
4 | labels: question
5 | ---
6 |
7 |
11 |
12 | ## What are you trying to achieve
13 |
14 |
17 |
18 | ## Minimal example (if applicable)
19 |
20 |
24 |
--------------------------------------------------------------------------------
/zsh-docker.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | #
5 | # Defines alias for docker.
6 | #
7 | # Requirements:
8 | # - docker: https://www.docker.com
9 | # - zsh: https://www.zsh.org/
10 | #
11 | # Authors:
12 | # Luis Mayta
13 | #
14 | # shellcheck disable=SC2034 # Unused variables left for readability
15 | ZSH_DOCKER_PATH=$(dirname "${0}")
16 |
17 | # shellcheck source=/dev/null
18 | source "${ZSH_DOCKER_PATH}"/config/main.zsh
19 |
20 | # shellcheck source=/dev/null
21 | source "${ZSH_DOCKER_PATH}"/internal/main.zsh
22 |
23 | # shellcheck source=/dev/null
24 | source "${ZSH_DOCKER_PATH}"/pkg/main.zsh
25 |
--------------------------------------------------------------------------------
/config/base.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | export ZSH_DOCKER_PACKAGE_NAME=docker
5 | export ZSH_DOCKER_CONTAINER_APP_NAME="${JASPER_CONTAINER_APP_NAME:-orbstack}"
6 | export ZSH_DOCKER_PODMAN_MACHINE_NAME="podman-machine-default"
7 | export ZSH_DOCKER_LIMA_MACHINE_NAME="default"
8 | export ZSH_DOCKER_MESSAGE_BREW="Please install brew or use antibody bundle hadenlabs/zsh-brew"
9 | export ZSH_DOCKER_MESSAGE_YAY="Please install Go or use antibody bundle hadenlabs/zsh-goenv"
10 | export ZSH_DOCKER_MESSAGE_RVM="Please install rvm or use antibody bundle hadenlabs/zsh-rvm"
11 | export ZSH_DOCKER_MESSAGE_NVM="Please install nvm or use antibody bundle hadenlabs/zsh-nvm"
--------------------------------------------------------------------------------
/.ci/linters/markdown-link-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "baseUrl": "https://github.com/hadenlabs/zsh-docker",
3 | "ignorePatterns": [
4 | {
5 | "pattern": "^https://hadenlabs.com"
6 | },
7 | {
8 | "pattern": "^mailto:.*@hadenlabs\\.com"
9 | },
10 | {
11 | "pattern": "^http://localhost"
12 | }
13 | ],
14 | "replacementPatterns": [
15 | {
16 | "pattern": "^/docs",
17 | "replacement": "{{BASEURL}}/docs"
18 | },
19 | {
20 | "pattern": "^/",
21 | "replacement": "{{BASEURL}}/"
22 | }
23 | ],
24 | "timeout": "20s",
25 | "retryCount": 3,
26 | "fallbackRetryDelay": "30s",
27 | "aliveStatusCodes": [200, 206, 202]
28 | }
29 |
--------------------------------------------------------------------------------
/.ci/linters/yamllint.config.yaml:
--------------------------------------------------------------------------------
1 | ignore: |
2 | .gitlab/
3 |
4 | extends: default
5 |
6 | rules:
7 | braces:
8 | level: warning
9 | max-spaces-inside: 1
10 | brackets:
11 | level: warning
12 | max-spaces-inside: 1
13 | colons:
14 | level: warning
15 | commas:
16 | level: warning
17 | comments: disable
18 | comments-indentation: disable
19 | document-start: disable
20 | empty-lines:
21 | level: warning
22 | hyphens:
23 | level: warning
24 | indentation:
25 | level: warning
26 | indent-sequences: consistent
27 | line-length:
28 | max: 180
29 | level: warning
30 | allow-non-breakable-inline-mappings: true
31 | truthy: disable
32 |
--------------------------------------------------------------------------------
/pkg/main.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function docker::pkg::main::factory {
5 | # shellcheck source=/dev/null
6 | source "${ZSH_DOCKER_PATH}"/pkg/base.zsh
7 | case "${OSTYPE}" in
8 | darwin*)
9 | # shellcheck source=/dev/null
10 | source "${ZSH_DOCKER_PATH}"/pkg/osx.zsh
11 | ;;
12 | linux*)
13 | # shellcheck source=/dev/null
14 | source "${ZSH_DOCKER_PATH}"/pkg/linux.zsh
15 | ;;
16 | esac
17 | # shellcheck source=/dev/null
18 | source "${ZSH_DOCKER_PATH}"/pkg/helper.zsh
19 |
20 | # shellcheck source=/dev/null
21 | source "${ZSH_DOCKER_PATH}"/pkg/alias.zsh
22 | }
23 |
24 | docker::pkg::main::factory
25 |
--------------------------------------------------------------------------------
/.ci/linters/.hadolint.yaml:
--------------------------------------------------------------------------------
1 | ignored:
2 | - DL3008 # Pin versions in apt get install. Instead of `apt-get install ` use `apt-get install =`
3 | - DL3013 # Pin versions in pip. Instead of `pip install ` use `pip install ==`
4 | - DL3016 # Pin versions in npm. Instead of `npm install ` use `npm install @
5 | - DL3018 # Pin versions in apk add. Instead of `apk add ` use `apk add =
6 | - DL3028 # Pin versions in gem install. Instead of `gem install ` use `gem install :`
7 |
8 | - SC2086 # info: Double quote to prevent globbing and word splitting.
9 |
10 | # temp
11 |
12 | - DL4006 # Set the SHELL option -o pipefail before RUN with a pipe in it
13 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [hadenlabs]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: luismayta # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: luismayta # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom:
13 | - https://www.paypal.me/luismayta
14 | - https://www.buymeacoffee.com/luismayta
15 | - https://amzn.com/w/1VJ9F3BEK0S8B
16 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## The problem
2 |
3 | Briefly describe the issue you are experiencing (or the feature you want to see added). Tell us what you were trying to do and what happened instead. Remember, this is _not_ a place to ask questions.
4 |
5 | ## Environment
6 |
7 | - OS: {Please write here}
8 | - Python version: {Please write here}
9 |
10 | ## Details
11 |
12 | If necessary, describe the problem you have been experiencing in more detail.
13 |
14 | ## Link to logs
15 |
16 | Create a [GIST](https://gist.github.com) which is a paste of your _full_ logs, and link them here. Do _NOT_ paste your full logs here, as it will make this issue very long and hard to read! If you are reporting a bug, _always_ include logs!
17 |
18 | ## Tasks
19 |
20 | - [ ] Task number 1
21 |
--------------------------------------------------------------------------------
/docs/include/installation/antigen.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | ### [antigen](https://github.com/zsh-users/antigen) users
12 |
13 | If you're using [Antigen](https://github.com/zsh-users/antigen), install this plugin by doing the following:
14 |
15 | 1. Add `antigen bundle hadenlabs/zsh-docker` to your `.zshrc` where you're adding your other plugins.
16 | 2. Either open a new terminal to force zsh to load the new plugin, or run `antigen bundle hadenlabs/zsh-docker` in a running zsh session.
17 | 3. Enjoy!
18 |
--------------------------------------------------------------------------------
/.github/workflows/lint.yml:
--------------------------------------------------------------------------------
1 | name: lint-code
2 |
3 | on:
4 | pull_request:
5 | branches:
6 | - main
7 |
8 | push:
9 | branches:
10 | - main
11 |
12 | tags:
13 | - "[0-9]+.[0-9]+.[0-9]+"
14 | # https://semver.org/ proper release tags, more or less
15 | - "v[0-9]+.[0-9]+.[0-9]+"
16 | # prerelease tags, more or less
17 | - "v[0-9]+.[0-9]+.[0-9]+-*"
18 |
19 | env:
20 | TASK_X_REMOTE_TASKFILES: 1
21 |
22 | permissions:
23 | contents: read
24 | pull-requests: read
25 |
26 | jobs:
27 | pre-commit:
28 | runs-on: ubuntu-20.04
29 | steps:
30 | - name: Checkout
31 | if: ${{ !env.ACT }}
32 | uses: actions/checkout@v3
33 | - uses: hadenlabs/action-pre-commit@0.2.0
34 | with:
35 | args: run --all-files
36 |
--------------------------------------------------------------------------------
/docs/include/installation/oh-my-zsh.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | ### [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) users
12 |
13 | If you're using [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh), install this plugin by doing the following:
14 |
15 | 1. Go to your oh-my-zsh custom plugins directory -`cd ~/.oh-my-zsh/custom/plugins`
16 | 2. Clone the plugin `bash git clone https://github.com/hadenlabs/zsh-docker`bash
17 | 3. Edit your `.zshrc` and add `plugins=( ... zsh-docker )` to your list of plugins
18 | 4. Open a new terminal and enjoy!
19 |
--------------------------------------------------------------------------------
/docs/include/installation/antibody.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | ### [antibody](https://github.com/getantibody/antibody) users
11 |
12 | If you're using [Antibody](https://github.com/getantibody/antibody), install this plugin by doing the following:
13 |
14 | 1. Add :
15 |
16 | ```{.sourceCode .bash}
17 | antibody bundle hadenlabs/zsh-docker
18 | ```
19 |
20 | to your `.zshrc` where you're adding your other plugins.
21 |
22 | 2. Either open a new terminal to force zsh to load the new plugin, or run `antibody bundle hadenlabs/zsh-docker` in a running zsh session.
23 | 3. Enjoy!
24 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | # Security Policy
10 |
11 | ## Reporting a Security Bug
12 |
13 | If you think you have discovered a security issue in any of the zsh-docker projects, we'd love to hear from you. We will take all security bugs seriously and if confirmed upon investigation we will patch it within a reasonable amount of time and release a public security bulletin discussing the impact and credit the discoverer.
14 |
15 | There are two ways to report a security bug. The easiest is to email a description of the flaw and any related information (e.g. reproduction steps, version) to [security at zsh-docker dot org](mailto:security@hadenlabs.com).
16 |
--------------------------------------------------------------------------------
/.ci/linters/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | parser: "@typescript-eslint/parser",
3 | env: {
4 | node: true,
5 | es2021: true
6 | },
7 | parserOptions: {
8 | ecmaVersion: 6,
9 | sourceType: "module" // Allows for the use of imports
10 | },
11 | extends: [
12 | "plugin:prettier/recommended",
13 | "plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
14 | "plugin:import/warnings"
15 | ],
16 | plugins: ["@typescript-eslint"],
17 | rules: {
18 | "@typescript-eslint/semicolon": "off",
19 | "@typescript-eslint/member-delimiter-style": "off",
20 | "@typescript-eslint/naming-convention": "warn",
21 | "@typescript-eslint/semi": "off",
22 | "no-throw-literal": "warn",
23 | curly: "warn",
24 | eqeqeq: "warn",
25 | semi: "off"
26 | },
27 | ignorePatterns: ["**/*.d.ts"]
28 | }
29 |
--------------------------------------------------------------------------------
/.github/workflows/sonarqube.yml:
--------------------------------------------------------------------------------
1 | name: sonarqube
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | tags:
9 | - "[0-9]+.[0-9]+.[0-9]+"
10 | # https://semver.org/ proper release tags, more or less
11 | - "v[0-9]+.[0-9]+.[0-9]+"
12 | # prerelease tags, more or less
13 | - "v[0-9]+.[0-9]+.[0-9]+-*"
14 |
15 | env:
16 | SONAR_HOST_URL: "${{ secrets.SONAR_HOST_URL }}"
17 | SONAR_LOGIN: "${{ secrets.SONAR_LOGIN }}"
18 | TASK_X_REMOTE_TASKFILES: 1
19 |
20 | jobs:
21 | sonar-scan:
22 | runs-on: ubuntu-20.04
23 |
24 | steps:
25 | - name: Check out a copy of the repo
26 | if: ${{ !env.ACT }}
27 | uses: actions/checkout@v3
28 | with:
29 | fetch-depth: 2
30 |
31 | - name: Install Task
32 | uses: arduino/setup-task@v1
33 |
34 | - name: Scan Sonar
35 | if: ${{ !env.ACT }}
36 | run: task sonar:scan --yes
37 |
--------------------------------------------------------------------------------
/.ci/config/.terraform-docs.yml:
--------------------------------------------------------------------------------
1 | formatter: "markdown" # this is required
2 | version: ""
3 |
4 | header-from: main.tf
5 | footer-from: ""
6 |
7 | recursive:
8 | enabled: false
9 | path: modules
10 |
11 | sections:
12 | hide: []
13 | show: []
14 |
15 | content: ""
16 |
17 | output:
18 | file: "docs/include/terraform.md"
19 | mode: replace
20 | template: |-
21 |
22 |
23 | {{ .Content }}
24 |
25 |
26 |
27 | output-values:
28 | enabled: false
29 | from: ""
30 |
31 | sort:
32 | enabled: true
33 | by: name
34 |
35 | settings:
36 | anchor: false
37 | color: true
38 | default: true
39 | description: false
40 | escape: true
41 | hide-empty: false
42 | html: true
43 | indent: 2
44 | lockfile: true
45 | read-comments: true
46 | required: true
47 | sensitive: true
48 | type: true
49 |
--------------------------------------------------------------------------------
/.ci/linters/.tflint.hcl:
--------------------------------------------------------------------------------
1 | plugin "aws" {
2 | enabled = true
3 | version = "0.38.0"
4 | source = "github.com/terraform-linters/tflint-ruleset-aws"
5 | }
6 | rule "terraform_deprecated_index" {
7 | enabled = true
8 | }
9 | rule "terraform_unused_declarations" {
10 | enabled = true
11 | }
12 | rule "terraform_comment_syntax" {
13 | enabled = true
14 | }
15 | rule "terraform_documented_outputs" {
16 | enabled = true
17 | }
18 | rule "terraform_documented_variables" {
19 | enabled = true
20 | }
21 | rule "terraform_typed_variables" {
22 | enabled = true
23 | }
24 | rule "terraform_naming_convention" {
25 | enabled = true
26 | }
27 | rule "terraform_required_version" {
28 | enabled = true
29 | }
30 | rule "terraform_standard_module_structure" {
31 | enabled = true
32 | }
33 | rule "terraform_required_providers" {
34 | enabled = false
35 | }
36 | rule "terraform_module_pinned_source" {
37 | enabled = true
38 | style = "semver"
39 | }
40 |
--------------------------------------------------------------------------------
/.chglog/CHANGELOG.tpl.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file. This file uses change log convention from [keep a CHANGELOG](http://keepachangelog.com/en/0.3.0/).
4 |
5 | {{ range .Versions }}
6 |
7 | ## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }}
8 |
9 | > {{ datetime "2006-01-02" .Tag.Date }}
10 |
11 | {{ range .CommitGroups -}}
12 |
13 | ### {{ .Title }}
14 |
15 | {{ range .Commits -}}
16 | * {{ .Subject }}
17 | {{ end }}
18 | {{ end -}}
19 |
20 | {{- if .RevertCommits -}}
21 |
22 | ### Reverts
23 |
24 | {{ range .RevertCommits -}}
25 | * {{ .Revert.Header }}
26 | {{ end }}
27 | {{ end -}}
28 |
29 | {{- if .NoteGroups -}}
30 | {{ range .NoteGroups -}}
31 | ### {{ .Title }}
32 |
33 | {{ range .Notes }}
34 | {{ .Body }}
35 | {{ end }}
36 | {{ end -}}
37 | {{ end -}}
38 | {{ end -}}
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 🐛 Bug report
3 | about: Create a report to help us improve
4 | labels: type/bug
5 | ---
6 |
7 | ## The problem
8 |
9 | Briefly describe the issue you are experiencing (or the feature you want to see added). Tell us what you were trying to do and what happened instead. Remember, this is _not_ a place to ask questions.
10 |
11 | ## Environment
12 |
13 | - OS: {Please write here}
14 | - Version : {Please write here}
15 |
16 | ## Details
17 |
18 | If necessary, describe the problem you have been experiencing in more detail.
19 |
20 | ## Link to logs
21 |
22 | Create a [GIST](https://gist.github.com) which is a paste of your _full_ logs, and link them here. Do _NOT_ paste your full logs here, as it will make this issue very long and hard to read! If you are reporting a bug, _always_ include logs!
23 |
24 | ## Tasks
25 |
26 | - [ ] Task number 1
27 |
28 | ## Checklist (after created issue)
29 |
30 | - [ ] Added label(s)
31 | - [ ] Added to project
32 | - [ ] Added to milestone
33 |
--------------------------------------------------------------------------------
/docs/roadmap.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
22 |
23 |
27 |
28 | # Roadmap 2021
29 |
30 | The Roadmap is a list of all the things we're working on for the year.
31 |
32 | You can see the corresponding projects on [zsh-docker](https://github.com/hadenlabs/zsh-docker)
33 |
34 | ## Legend
35 |
36 | - :todo: : To Do
37 | - :done: : done
38 | - :wip: : work in progress
39 | - :feedback: : actively looking for feedback
40 |
41 | ## Epics
42 |
43 | ## Long Lived Initiatives
44 |
--------------------------------------------------------------------------------
/docs/releasing.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | # Releasing
11 |
12 | ## Bump a new version
13 |
14 | Make a new version of zsh-docker in the following steps:
15 |
16 | ### Generate version major
17 |
18 | ```bash
19 | task version:major
20 | ```
21 |
22 | ### Generate version minor
23 |
24 | ```bash
25 | task version:minor
26 | ```
27 |
28 | ### Generate version patch
29 |
30 | ```bash
31 | task version:patch
32 | ```
33 |
34 | ## Generate Changelog
35 |
36 | ### Generate Changelog Next Tag
37 |
38 | ```bash
39 | task changelog:next APP_TAG={{tag}}
40 | ```
41 |
42 | #### Parameters
43 |
44 | | Name | Description | sample | Required |
45 | | -------- | ------------- | ------ | :------: |
46 | | tag name | Name next tag | 0.1.0 | yes |
47 |
48 | ### Generate Changelog Tag Now
49 |
50 | ```bash
51 | task changelog:tag
52 | ```
53 |
--------------------------------------------------------------------------------
/internal/colima.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function container::internal::container::install {
5 | if core::exists colima; then
6 | return
7 | fi
8 | message_info "Installing ${ZSH_DOCKER_PACKAGE_NAME}"
9 | core::install colima
10 |
11 | if ! core::exists docker; then
12 | core::install docker
13 | fi
14 |
15 | message_success "Installed ${ZSH_DOCKER_PACKAGE_NAME}"
16 | }
17 |
18 | function check_command {
19 | if ! command -v "$1" >/dev/null 2>&1; then
20 | echo "❌ '$1' is required but not installed. Please install it with: brew install $1"
21 | return 1
22 | fi
23 | return 0
24 | }
25 |
26 | function container::internal::container::load {
27 | check_command jq || return 1
28 | check_command colima || return 1
29 |
30 | local docker_socket
31 | docker_socket=$(colima status --json 2>/dev/null | jq -r '.docker_socket // empty')
32 |
33 | if [[ -z "$docker_socket" ]]; then
34 | echo "🚀 Colima does not seem to be running (docker_socket is empty). Starting Colima..."
35 | colima start
36 | fi
37 | }
--------------------------------------------------------------------------------
/provision/diagrams/Taskfile.yml:
--------------------------------------------------------------------------------
1 | # https://taskfile.dev
2 |
3 | version: "3"
4 |
5 | vars:
6 | FILES_PLANTUML:
7 | sh: >-
8 | find ./ -type f -name '*.plantuml'
9 | | grep -v '.terraform'
10 | | sort -u
11 | | xargs
12 |
13 | tasks:
14 | build:
15 | desc: Build Diagrams Plantuml.
16 | run: once
17 | silent: true
18 | cmds:
19 | - cmd: mkdir -p decks/images/diagrams
20 | - cmd: mkdir -p static/images/diagrams
21 | - cmd: mkdir -p docs/images/diagrams
22 | - task: make
23 |
24 | publish:
25 | desc: Publish Diagrams.
26 | run: once
27 | silent: true
28 | deps:
29 | - task: build
30 | cmds:
31 | - >-
32 | rsync -avhP --remove-source-files
33 | --include='*.png' --include='*/'
34 | --exclude='*'
35 | provision/diagrams/ ./
36 |
37 | make:
38 | desc: generate files plantuml.
39 | cmds:
40 | - cmd: echo {{.FILES_PLANTUML}}
41 | - >-
42 | docker run
43 | --platform linux/amd64
44 | --rm
45 | --workdir /data
46 | -v {{.PWD}}:/data
47 | hadenlabs/plantuml {{.FILES_PLANTUML}}
48 |
--------------------------------------------------------------------------------
/.github/workflows/confluence.yml:
--------------------------------------------------------------------------------
1 | name: confluence
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | tags:
9 | - "[0-9]+.[0-9]+.[0-9]+"
10 | # https://semver.org/ proper release tags, more or less
11 | - "v[0-9]+.[0-9]+.[0-9]+"
12 | # prerelease tags, more or less
13 | - "v[0-9]+.[0-9]+.[0-9]+-*"
14 |
15 | env:
16 | TASK_X_REMOTE_TASKFILES: 1
17 |
18 | jobs:
19 | confluence:
20 | runs-on: ubuntu-20.04
21 | steps:
22 | - name: Check out a copy of the repo
23 | if: ${{ !env.ACT }}
24 | uses: actions/checkout@v3
25 | with:
26 | fetch-depth: 0
27 |
28 | - name: Get changed files
29 | id: changed-files
30 | uses: tj-actions/changed-files@v26
31 | with:
32 | files: |
33 | docs/*.md
34 | files_ignore: |
35 | *.tpl.md
36 | ^.terraform
37 |
38 | - name: Sync confluence
39 | uses: hadenlabs/action-confluence-sync@0.1.0
40 | with:
41 | files: "${{ steps.changed-files.outputs.all_changed_files }}"
42 | confluence_url: ${{ secrets.CONFLUENCE_BASE_URL }}
43 | confluence_username: ${{ secrets.CONFLUENCE_USER }}
44 | confluence_token: ${{ secrets.CONFLUENCE_ACCESS_TOKEN }}
45 |
--------------------------------------------------------------------------------
/config/main.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function docker::config::main::factory {
5 | # shellcheck source=/dev/null
6 | source "${ZSH_DOCKER_PATH}"/config/base.zsh
7 | case "${OSTYPE}" in
8 | darwin*)
9 | # shellcheck source=/dev/null
10 | source "${ZSH_DOCKER_PATH}"/config/osx.zsh
11 | ;;
12 | linux*)
13 | # shellcheck source=/dev/null
14 | source "${ZSH_DOCKER_PATH}"/config/linux.zsh
15 | ;;
16 | esac
17 |
18 | case "${ZSH_DOCKER_CONTAINER_APP_NAME}" in
19 | colima*)
20 | # shellcheck source=/dev/null
21 | source "${ZSH_DOCKER_PATH}"/config/colima.zsh
22 | ;;
23 | lima*)
24 | # shellcheck source=/dev/null
25 | source "${ZSH_DOCKER_PATH}"/config/lima.zsh
26 | ;;
27 | podman*)
28 | # shellcheck source=/dev/null
29 | source "${ZSH_DOCKER_PATH}"/config/podman.zsh
30 | ;;
31 | docker*)
32 | # shellcheck source=/dev/null
33 | source "${ZSH_DOCKER_PATH}"/config/docker.zsh
34 | ;;
35 | orbstack*)
36 | # shellcheck source=/dev/null
37 | source "${ZSH_DOCKER_PATH}"/config/orbstack.zsh
38 | ;;
39 | esac
40 | }
41 |
42 | docker::config::main::factory
43 | container::core
--------------------------------------------------------------------------------
/internal/podman.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function container::internal::container::install {
5 | if core::exists podman; then
6 | return
7 | fi
8 | message_info "Installing ${ZSH_DOCKER_PACKAGE_NAME}"
9 | core::install podman
10 | message_success "Installed ${ZSH_DOCKER_PACKAGE_NAME}"
11 | }
12 |
13 | function container::internal::container::load {
14 | local machine_name="${ZSH_DOCKER_PODMAN_MACHINE_NAME:-podman-machine-default}"
15 |
16 | # Check if jq is installed
17 | if ! command -v jq >/dev/null 2>&1; then
18 | echo "❌ 'jq' is required but not installed. Please install it with: brew install jq"
19 | return 1
20 | fi
21 |
22 | # Check if the Podman machine exists
23 | if ! podman machine list | grep -q "${machine_name}"; then
24 | echo "🔧 Podman machine '${machine_name}' not found. Initializing..."
25 | podman machine init --now --name "${machine_name}"
26 | return
27 | fi
28 |
29 | # Check if the machine is running
30 | local running
31 | running=$(podman machine list --format json | jq -r \
32 | --arg name "$machine_name" '.[] | select(.Name == $name) | .Running')
33 |
34 | if [[ "${running}" != "true" ]]; then
35 | echo "🚀 Podman machine '${machine_name}' exists but is not running. Starting..."
36 | podman machine start "${machine_name}"
37 | fi
38 | }
--------------------------------------------------------------------------------
/internal/lima.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function container::internal::container::install {
5 | if core::exists lima; then
6 | return
7 | fi
8 | message_info "Installing ${ZSH_DOCKER_PACKAGE_NAME}"
9 | core::install lima
10 | message_success "Installed ${ZSH_DOCKER_PACKAGE_NAME}"
11 | }
12 |
13 | function container::internal::container::load {
14 | local machine_name="${ZSH_DOCKER_LIMA_MACHINE_NAME:-default}"
15 |
16 | # Check if jq is installed
17 | if ! command -v jq >/dev/null 2>&1; then
18 | echo "❌ 'jq' is required but not installed. Please install it with: brew install jq"
19 | return 1
20 | fi
21 |
22 | # Check if the Lima machine exists
23 | if ! limactl list --json | jq -e --arg name "$machine_name" '.[] | select(.name == $name)' >/dev/null; then
24 | echo "🔧 Lima machine '${machine_name}' does not exist. Initializing..."
25 | limactl start "$machine_name"
26 | return
27 | fi
28 |
29 | # Check if the machine is running
30 | local running
31 | running=$(limactl list --json | jq -r --arg name "$machine_name" '.[] | select(.name == $name) | .state')
32 |
33 | if [[ "$running" != "Running" ]]; then
34 | echo "🚀 Lima machine '${machine_name}' exists but is not running. Starting..."
35 | limactl start "$machine_name"
36 | else
37 | echo "✅ Lima machine '${machine_name}' is already running."
38 | fi
39 | }
--------------------------------------------------------------------------------
/.chglog/config.yml:
--------------------------------------------------------------------------------
1 | style: github
2 | template: CHANGELOG.tpl.md
3 | info:
4 | title: CHANGELOG
5 | repository_url: https://github.com/hadenlabs/zsh-docker
6 | options:
7 | commits:
8 | filters:
9 | Type:
10 | - chore
11 | - feat
12 | - fix
13 | - perf
14 | - refactor
15 | sort_by: Scope
16 |
17 | commit_groups:
18 | group_by: Type
19 | sort_by: Title
20 | title_order:
21 | - feat
22 | - chore
23 | - fix
24 | - perf
25 | - refactor
26 |
27 | title_maps:
28 | feat: ✨ Features
29 | fix: 🐛 Bug Fixes
30 | fixed: 🐛 Bug Fixes
31 | perf: ⚡ Performance Improvements
32 | docs: 📝 Docs changes
33 | refactor: 🎨 Code Refactoring
34 | rename: 🚚 Renamed
35 | revert: ⏪ Reverted
36 | update: 🔄 Updates
37 | build: 👷 Building scripts changes
38 | chore: Other changes
39 | style: 💄 Code styling
40 | ci: 👷 CI changes
41 |
42 | header:
43 | pattern: "^(\\w+)(?:\\s*.*)?(?:\\s*\\((.*?)\\))?:\\s*(.*)$"
44 | pattern_maps:
45 | - Type
46 | - Scope
47 | - Subject
48 |
49 | merges:
50 | pattern: "^Merge branch '(\\w+)'$"
51 | pattern_maps:
52 | - Source
53 |
54 | reverts:
55 | pattern: "^Revert \"([\\s\\S]*)\"$"
56 | pattern_maps:
57 | - Header
58 |
59 | notes:
60 | keywords:
61 | - BREAKING CHANGE
62 | - 💥
63 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Proposed changes
2 |
3 | Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
4 |
5 | ## Types of changes
6 |
7 | What types of changes does your code introduce to Project? _Put an `x` in the boxes that apply_
8 |
9 | - [ ] Bugfix (non-breaking change which fixes an issue)
10 | - [ ] New feature (non-breaking change which adds functionality)
11 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12 |
13 | ## Checklist
14 |
15 | _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
16 |
17 | - [ ] I have read the [CONTRIBUTING](/docs/contributing.md) doc
18 | - [ ] Lint and unit tests pass locally with my changes
19 | - [ ] I have added tests that prove my fix is effective or that my feature works
20 | - [ ] I have added necessary documentation (if appropriate)
21 | - [ ] Any dependent changes have been merged and published in downstream modules
22 |
23 | ## Further comments
24 |
25 | If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...
26 |
--------------------------------------------------------------------------------
/internal/main.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function docker::internal::main::factory {
5 | # shellcheck source=/dev/null
6 | source "${ZSH_DOCKER_PATH}"/internal/base.zsh
7 | case "${OSTYPE}" in
8 | darwin*)
9 | # shellcheck source=/dev/null
10 | source "${ZSH_DOCKER_PATH}"/internal/osx.zsh
11 | ;;
12 | linux*)
13 | # shellcheck source=/dev/null
14 | source "${ZSH_DOCKER_PATH}"/internal/linux.zsh
15 | ;;
16 | esac
17 |
18 | case "${ZSH_DOCKER_CONTAINER_APP_NAME}" in
19 | colima*)
20 | # shellcheck source=/dev/null
21 | source "${ZSH_DOCKER_PATH}"/internal/colima.zsh
22 | ;;
23 | lima*)
24 | # shellcheck source=/dev/null
25 | source "${ZSH_DOCKER_PATH}"/internal/lima.zsh
26 | ;;
27 | podman*)
28 | # shellcheck source=/dev/null
29 | source "${ZSH_DOCKER_PATH}"/internal/podman.zsh
30 | ;;
31 | docker*)
32 | # shellcheck source=/dev/null
33 | source "${ZSH_DOCKER_PATH}"/internal/docker.zsh
34 | ;;
35 | orbstack*)
36 | # shellcheck source=/dev/null
37 | source "${ZSH_DOCKER_PATH}"/internal/orbstack.zsh
38 | ;;
39 | esac
40 | # shellcheck source=/dev/null
41 | source "${ZSH_DOCKER_PATH}"/internal/helper.zsh
42 | }
43 |
44 | docker::internal::main::factory
45 |
46 | container::internal::container::install
47 | container::internal::container::load
--------------------------------------------------------------------------------
/docs/commands.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | # Commands
11 |
12 | ## Poetry
13 |
14 | ## Taskfile
15 |
16 | ### Confluence
17 |
18 | #### Sync Markdown with confluence
19 |
20 | ```{.bash}
21 | task confluence:sync:all
22 | ```
23 |
24 | ### Python
25 |
26 | #### Format syntax code python with [black](https://github.com/psf/black)
27 |
28 | ```{.bash}
29 | task python:fmt -- {{file_name or path}}
30 | ```
31 |
32 | ### Diagrams
33 |
34 | #### Publish diagrams
35 |
36 | ```{.bash}
37 | task diagrams:publish
38 | ```
39 |
40 | ### Mkdocs
41 |
42 | #### Generate Website
43 |
44 | ```{.bash}
45 | task docs:build
46 | ```
47 |
48 | ### Changelog
49 |
50 | #### Generate Changelog Next Tag
51 |
52 | ```{.bash}
53 | task changelog:next APP_TAG={{tag name}}
54 | ```
55 |
56 | #### Parameters
57 |
58 | | Name | Description | sample | Required |
59 | | -------- | ------------- | ------ | :------: |
60 | | tag name | Name next tag | 0.1.0 | yes |
61 |
62 | ### Version
63 |
64 | #### Version Major
65 |
66 | ```{.bash}
67 | task version:major
68 | ```
69 |
70 | #### Version Minor
71 |
72 | ```{.bash}
73 | task version:minor
74 | ```
75 |
76 | #### Version Patch
77 |
78 | ```{.bash}
79 | task version:patch
80 | ```
81 |
82 | ### Docs
83 |
84 | #### build
85 |
86 | ```{.bash}
87 | task docs:build
88 | ```
89 |
90 | #### server
91 |
92 | ```{.bash}
93 | task docs:serve
94 | ```
95 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 |
2 | # EditorConfig is awesome: http://EditorConfig.org
3 |
4 |
5 | # top-most EditorConfig file
6 | root = true
7 |
8 | # Unix-style newlines with a newline ending every file
9 | [*]
10 | end_of_line = lf
11 | insert_final_newline = false
12 | indent_style = space
13 | # Set default charset
14 | charset = utf-8
15 | trim_trailing_whitespace = true
16 | indent_size = 2
17 |
18 | # Custom Coding Styles for Java files
19 | [*.java]
20 |
21 | # The other allowed value you can use is space
22 | indent_style = tab
23 |
24 | # You can play with this value and set it to how
25 | # many characters you want your indentation to be
26 | indent_size = 2
27 |
28 | # Character set to be used in java files.
29 | charset = utf-8
30 | trim_trailing_whitespace = true
31 |
32 | [*.{el}]
33 | insert_final_newline = false
34 |
35 | [*.{el,md,mdx,yml,yaml,js,json,toml,ts,tsx,hcl,tf,graphql,hbs,sh,lua}]
36 | indent_style = space
37 | indent_size = 2
38 |
39 | [*.{lua}]
40 | indent_style = space
41 | indent_size = 2
42 |
43 | # 4 space indentation
44 | [*.{py}]
45 | indent_style = space
46 | indent_size = 4
47 |
48 | [*.go]
49 | indent_size = 2
50 | indent_style = tab
51 |
52 | # Minified JavaScript files shouldn't be changed
53 | [**.min.js]
54 | indent_style = ignore
55 | insert_final_newline = ignore
56 |
57 | # Tab indentation (no size specified)
58 | [Makefile]
59 | indent_style = tab
60 |
61 | # Indentation override for all JS under lib directory
62 | [*.{el,js,json,md,yml,yaml,tf}]
63 | indent_style = space
64 | indent_size = 2
65 |
66 | [*.{make,mk}]
67 | indent_style = tab
68 | indent_size = 4
69 |
70 | # Batch files use tabs for indentation
71 | [*.bat]
72 | indent_style = tab
73 |
--------------------------------------------------------------------------------
/.ci/linters/prettier.config.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | arrowParens: "always",
3 | printWidth: 120,
4 | proseWrap: "preserve",
5 | semi: false,
6 | singleQuote: false,
7 | tabWidth: 2,
8 | trailingComma: "none",
9 | overrides: [
10 | {
11 | files: "{*.js?(x),*.ts?(x),*.y?(a)ml,.*.y?(a)ml,*.md,.prettierrc,.stylelintrc,.babelrc}",
12 | options: {
13 | arrowParens: "always",
14 | printWidth: 100,
15 | semi: false,
16 | quoteProps: "as-needed",
17 | tabWidth: 2,
18 | trailingComma: "none"
19 | }
20 | },
21 | {
22 | files: "{*.lua}",
23 | options: {
24 | printWidth: 100,
25 | tabWidth: 2,
26 | quoteProps: "preserve"
27 | }
28 | },
29 |
30 | {
31 | files: "{*.json,.*.json,**/.vscode/*.json,**/tsconfig.json,**/tsconfig.*.json}",
32 | options: {
33 | parser: "json",
34 | tabWidth: 2,
35 | quoteProps: "preserve"
36 | }
37 | },
38 | {
39 | files: "*.md",
40 | options: {
41 | parser: "markdown",
42 | printWidth: 120,
43 | proseWrap: "never",
44 | semi: false,
45 | trailingComma: "none"
46 | }
47 | },
48 | {
49 | files: "*.mdx",
50 | options: {
51 | printWidth: 120,
52 | proseWrap: "never",
53 | semi: false,
54 | trailingComma: "none"
55 | }
56 | },
57 | {
58 | files: "*.{sass,scss}",
59 | options: {
60 | parser: "scss"
61 | }
62 | },
63 | {
64 | files: "*.less",
65 | options: {
66 | tabWidth: 4,
67 | printWidth: 80,
68 | parser: "less"
69 | }
70 | }
71 | ]
72 | }
73 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Configuration for probot-stale - https://github.com/probot/stale
2 |
3 | # Number of days of inactivity before an Issue or Pull Request becomes stale
4 | daysUntilStale: 20
5 |
6 | # Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7 | # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
8 | daysUntilClose: 7
9 |
10 | # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
11 | onlyLabels: []
12 |
13 | # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
14 | exemptLabels:
15 | - bug
16 | - kind/bug
17 | - status/backlog
18 | - enhancement
19 | - help wanted
20 | - priority/low
21 | - priority/medium
22 | - priority/high
23 | - priority/critical
24 | - good first issue
25 | - pinned
26 | - security
27 | - planned
28 |
29 | # Set to true to ignore issues in a project (defaults to false)
30 | exemptProjects: false
31 |
32 | # Set to true to ignore issues in a milestone (defaults to false)
33 | exemptMilestones: false
34 |
35 | # Set to true to ignore issues with an assignee (defaults to false)
36 | exemptAssignees: false
37 |
38 | # Label to use when marking as stale
39 | staleLabel: closing/stale
40 |
41 | # Comment to post when marking as stale. Set to `false` to disable
42 | markComment: >
43 | This issue has been automatically marked as stale because it has not had
44 | any recent activity. It will be closed if no further activity occurs.
45 |
46 | # Comment to post when removing the stale label.
47 | # unmarkComment: >
48 | # Your comment here.
49 |
50 | # Comment to post when closing a stale Issue or Pull Request.
51 | closeComment: >
52 | This issue has been automatically closed due to a lack of activity
53 | for an extended period of time.
54 |
55 | # Limit to only `issues` or `pulls`
56 | only: issues
57 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: create-release
2 |
3 | on:
4 | push:
5 | tags:
6 | - "[0-9]+.[0-9]+.[0-9]+"
7 | # https://semver.org/ proper release tags, more or less
8 | - "v[0-9]+.[0-9]+.[0-9]+"
9 | # prerelease tags, more or less
10 | - "v[0-9]+.[0-9]+.[0-9]+-*"
11 |
12 | env:
13 | TMP_CHANGELOG_FILENAME: TMP_CHANGELOG.md
14 | ACTIONS_ALLOW_UNSECURE_COMMANDS: true
15 | TASK_X_REMOTE_TASKFILES: 1
16 |
17 | jobs:
18 | release:
19 | runs-on: ubuntu-24.04
20 | if: startsWith(github.ref, 'refs/tags/')
21 | container:
22 | image: golang:1.23
23 | steps:
24 | - name: Enabled secure repository
25 | run: |
26 | git config --global --add safe.directory ${GITHUB_WORKSPACE}
27 |
28 | - name: Check out a copy of the repo
29 | uses: actions/checkout@v4
30 | with:
31 | fetch-depth: 0
32 | fetch-tags: true
33 |
34 | - name: Install Task
35 | uses: arduino/setup-task@v1
36 |
37 | - name: Added go path to path
38 | run: |
39 | export PATH=$PATH:$(go env GOPATH)/bin
40 |
41 | - name: Install changelog
42 | run: task changelog:install --yes
43 |
44 | - name: Check dependences
45 | run: task changelog:check --yes
46 |
47 | - id: get_version
48 | uses: battila7/get-version-action@v2
49 |
50 | - name: Generate changelog
51 | run: task changelog:tag APP_TAG=${{ steps.get_version.outputs.version-without-v }} --yes
52 |
53 | - name: Create Release
54 | if: ${{ !env.ACT }}
55 | id: create_release
56 | uses: actions/create-release@v1
57 | env:
58 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
59 | with:
60 | tag_name: ${{ steps.get_version.outputs.version-without-v }}
61 | release_name: ${{ steps.get_version.outputs.version-without-v }}
62 | draft: false
63 | prerelease: false
64 | body_path: ${{ env.TMP_CHANGELOG_FILENAME }}
65 |
--------------------------------------------------------------------------------
/.ci/linters/.goreleaser.yml:
--------------------------------------------------------------------------------
1 | # This is an example goreleaser.yaml file with some sane defaults.
2 | # Make sure to check the documentation at http://goreleaser.com
3 | project_name: zsh-docker
4 | env:
5 | - GO111MODULE=on
6 | - REPO=github.com/hadenlabs/zsh-docker
7 | before:
8 | hooks:
9 | - go mod download
10 | - go mod tidy
11 | - go mod vendor
12 | - go generate ./...
13 |
14 | # https://goreleaser.com/build/
15 | builds:
16 | # Defaults to the project name.
17 | - id: default
18 | # ID of the build.
19 | env:
20 | - CGO_ENABLED=0
21 | ldflags:
22 | - -s -w
23 | - -X "{{.Env.REPO}}/cmd.Version={{.Version}}"
24 | - -X "{{.Env.REPO}}/cmd.Commit={{.FullCommit}}"
25 | - -X "{{.Env.REPO}}/cmd.RepoURL={{.GitURL}}"
26 | - -X "{{.Env.REPO}}/cmd.BuildDate={{.Date}}"
27 | - -X "{{.Env.REPO}}/cmd.BuiltWithGoVersion={{.Env.GO_VERSION}}"
28 | - -X "{{.Env.REPO}}/cmd.BuiltBy={{.Env.BUILT_BY}}"
29 | goos:
30 | - darwin
31 | - linux
32 | goarch:
33 | - amd64
34 | archives:
35 | - replacements:
36 | darwin: Darwin
37 | linux: Linux
38 | amd64: x86_64
39 | builds:
40 | - default
41 | wrap_in_directory: true
42 | name_template: "{{.ProjectName}}-{{.Os}}-{{.Arch}}"
43 | format: tar.gz
44 | format_overrides:
45 | - goos: windows
46 | format: zip
47 | files:
48 | - LICENSE
49 | - README.md
50 | - CHANGELOG.md
51 | - config/**/*
52 | - systemd/*
53 | # https://goreleaser.com/snapshots/
54 | snapshot:
55 | name_template: "dev@{{.ShortCommit}}"
56 |
57 | # https://goreleaser.com/checksum/
58 | checksum:
59 | name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
60 | algorithm: sha256
61 | changelog:
62 | sort: asc
63 | filters:
64 | exclude:
65 | - "^docs:"
66 | - "^test:"
67 |
68 | release:
69 | github:
70 | owner: hadenlabs
71 | name: zsh-docker
72 | draft: true
73 | prerelease: auto
74 | name_template: "{{.ProjectName}}-v{{.Version}}-{{.ShortCommit}}-{{.Date}}"
75 |
--------------------------------------------------------------------------------
/internal/base.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function docker::internal::login {
5 | echo -n "${DOCKERHUB_TOKEN}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin
6 | }
7 |
8 | function docker::internal::clean::all {
9 | docker system prune --all --force --volumes
10 | }
11 |
12 | # images docker
13 |
14 | function docker::internal::images::delete::dangling {
15 | docker images -q -f "dangling=true" | xargs docker image rm -f
16 | }
17 |
18 | function docker::internal::images::delete::all {
19 | docker image ls -a -q | xargs docker image rm -f
20 | }
21 |
22 | # process docker
23 |
24 | function docker::internal::process::list {
25 | docker ps -l "$@"
26 | }
27 |
28 | function docker::internal::process::stop::all {
29 | docker ps -q -f "status=running" | xargs docker stop
30 | }
31 |
32 | function docker::internal::process::stop::exited {
33 | docker ps -q -f "status=exited" | xargs docker rm
34 | }
35 |
36 | function docker::internal::process::delete::all {
37 | docker ps -a -q | xargs docker rm
38 | }
39 |
40 | # volume docker
41 |
42 | function docker::internal::volume::list::all {
43 | docker volume ls
44 | }
45 |
46 | function docker::internal::volume::delete::exited {
47 | docker ps -q -f "status=exited" | xargs docker rm -v
48 | }
49 |
50 | function docker::internal::volume::delete::all {
51 | docker volume ls -q | xargs docker volume rm -f
52 | }
53 |
54 | function docker::internal::volume::delete::dangling {
55 | docker volume ls -q -f "dangling=true" | xargs docker volume rm -f
56 | }
57 |
58 | # container docker
59 |
60 | function docker::internal::container::delete::all {
61 | docker container ls -a -q | xargs docker container stop
62 | docker container ls -a -q | xargs docker container rm
63 | }
64 |
65 | function docker::internal::container::stop::all {
66 | docker ps -q -f "status=running" | xargs docker stop
67 | }
68 |
69 | function docker::internal::container::stop::dangling {
70 | docker ps -q -f "dangling=true" | xargs docker stop
71 | }
72 |
73 | # networs docker
74 |
75 | function docker::internal::network::delete::all {
76 | docker network ls -q | xargs docker network rm -f
77 | }
--------------------------------------------------------------------------------
/provision/generators/README.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | #
3 | # This is the canonical configuration for the `README.md`
4 | # Run `make readme` to rebuild the `README.md`
5 | #
6 |
7 | # Name of this project
8 | name: zsh-docker
9 |
10 | email:
11 | support: support@hadenlabs.com
12 |
13 | # Logo for this project
14 | #logo: docs/logo.png
15 |
16 | # License of this project
17 | license: "LGPL-3.0"
18 |
19 | # Canonical GitHub repo
20 | github_repo: hadenlabs/zsh-docker
21 |
22 | # Badges to display
23 | badges:
24 | - name: Latest Release
25 | image: https://img.shields.io/github/release/hadenlabs/zsh-docker
26 | url: https://github.com/hadenlabs/zsh-docker/releases
27 | - name: Lint
28 | image: https://img.shields.io/github/workflow/status/hadenlabs/zsh-docker/lint-code
29 | url: https://github.com/hadenlabs/zsh-docker/actions?workflow=lint-code
30 | - name: CI
31 | image: https://img.shields.io/github/workflow/status/hadenlabs/zsh-docker/ci
32 | url: https://github.com/hadenlabs/zsh-docker/actions?workflow=ci
33 | - name: Test
34 | image: https://img.shields.io/github/workflow/status/hadenlabs/zsh-docker/test
35 | url: https://github.com/hadenlabs/zsh-docker/actions?workflow=test
36 | - name: pre-commit
37 | image: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
38 | url: https://github.com/pre-commit/pre-commit
39 | - name: Conventional Commits
40 | image: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow
41 | url: https://conventionalcommits.org
42 | - name: KeepAChangelog
43 | image: https://img.shields.io/badge/changelog-Keep%20a%20Changelog%20v1.0.0-orange
44 | url: https://keepachangelog.com
45 |
46 | requirements: |-
47 |
48 | This is a list of plugins that need to be installed previously to enjoy all the goodies of this configuration:
49 |
50 | - [zsh-core](https://github.com/hadenlabs/zsh-core)
51 | - [gomplate](https://github.com/hairyhenderson/gomplate)
52 | - [python](https://www.python.org)
53 | - [taskfile](https://github.com/go-task/task)
54 |
55 | # Short description of this project
56 | description: |-
57 | zsh-docker for project
58 |
59 | installation:
60 | - "docs/include/installation/oh-my-zsh.md"
61 | - "docs/include/installation/antigen.md"
62 | - "docs/include/installation/antibody.md"
63 |
64 | usages:
65 | - docs/usage.md
66 |
67 | include:
68 | - "docs/functions.md"
69 |
70 | examples:
71 | - "docs/examples/common.md"
72 |
--------------------------------------------------------------------------------
/pkg/base.zsh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ksh
2 | # -*- coding: utf-8 -*-
3 |
4 | function docker::login {
5 | docker::internal::login
6 | }
7 |
8 | function docker::clean::all {
9 | docker::internal::clean::all
10 | }
11 |
12 | function docker::clean::dangling {
13 | docker::clean::images::dangling
14 | docker::clean::volume::dangling
15 | }
16 |
17 | function docker::clean::images::all {
18 | docker::images::delete::all
19 | }
20 |
21 | function docker::clean::images::dangling {
22 | docker::images::delete::dangling
23 | }
24 |
25 | function docker::clean::process::all {
26 | docker::process::delete::all
27 | }
28 |
29 | function docker::clean::process::dangling {
30 | docker::process::delete::dangling
31 | }
32 |
33 | function docker::clean::volume::all {
34 | docker::volume::delete::all
35 | }
36 |
37 | function docker::clean::volume::dangling {
38 | docker::volume::delete::dangling
39 | }
40 |
41 | function docker::clean::network::all {
42 | docker::network::delete::all
43 | }
44 |
45 | function docker::clean::network::dangling {
46 | docker::network::delete::dangling
47 | }
48 |
49 | function docker::process::list {
50 | docker::internal::process::list
51 | }
52 |
53 | function docker::process::stop::all {
54 | docker::internal::process::stop::all
55 | }
56 |
57 | function docker::process::stop::exited {
58 | docker::internal::process::stop::exited
59 | }
60 |
61 | function docker::process::delete::all {
62 | docker::internal::process::delete::all
63 | }
64 |
65 | function docker::volume::delete::all {
66 | docker::internal::volume::delete::all
67 | }
68 |
69 | function docker::volume::list::all {
70 | docker::internal::volume::list::all
71 | }
72 |
73 | function docker::volume::delete::exited {
74 | docker::internal::volume::delete::exited
75 | }
76 |
77 | function docker::volume::delete::dangling {
78 | docker::internal::volume::delete::dangling
79 | }
80 |
81 | function docker::container::delete::all {
82 | docker::internal::container::delete::all
83 | }
84 |
85 | function docker::container::stop::all {
86 | docker::internal::container::stop::all
87 | }
88 |
89 | function docker::container::delete::dangling {
90 | docker::internal::container::delete::dangling
91 | }
92 |
93 | function docker::network::delete::all {
94 | docker::internal::network::delete::all
95 | }
96 |
97 | # images docker
98 |
99 | function docker::images::delete::dangling {
100 | docker::internal::images::delete::dangling
101 | }
102 |
103 | function docker::images::delete::all {
104 | docker::internal::images::delete::all
105 | }
--------------------------------------------------------------------------------
/.goji.json:
--------------------------------------------------------------------------------
1 | {
2 | "noemoji": false,
3 | "scopes": ["core", "accounts", "ci"],
4 | "signoff": true,
5 | "skipquestions": null,
6 | "subjectmaxlength": 100,
7 | "types": [
8 | {
9 | "emoji": "✨",
10 | "code": ":sparkles:",
11 | "description": "Introduce new features.",
12 | "name": "feat"
13 | },
14 | {
15 | "emoji": "🐛",
16 | "code": ":bug:",
17 | "description": "Fix a bug.",
18 | "name": "fix"
19 | },
20 | {
21 | "emoji": "📚",
22 | "code": ":books:",
23 | "description": "Documentation change.",
24 | "name": "docs"
25 | },
26 | {
27 | "emoji": "🎨",
28 | "code": ":art:",
29 | "description": "Improve structure/format of the code.",
30 | "name": "refactor"
31 | },
32 | {
33 | "emoji": "💄",
34 | "code": ":lipstick:",
35 | "description": "Update or improve style of the code.",
36 | "name": "style"
37 | },
38 | {
39 | "emoji": "🧹",
40 | "code": ":broom:",
41 | "description": "A chore change.",
42 | "name": "chore"
43 | },
44 | {
45 | "emoji": "🧪",
46 | "code": ":test_tube:",
47 | "description": "Add a test.",
48 | "name": "test"
49 | },
50 | {
51 | "emoji": "🚑",
52 | "code": ":ambulance:",
53 | "description": "Critical hotfix.",
54 | "name": "hotfix"
55 | },
56 | {
57 | "emoji": "⚰",
58 | "code": ":coffin:",
59 | "description": "Remove dead code.",
60 | "name": "deprecate"
61 | },
62 | {
63 | "emoji": "⚡",
64 | "code": ":zap:",
65 | "description": "Improve performance.",
66 | "name": "perf"
67 | },
68 | {
69 | "emoji": "🚧",
70 | "code": ":construction:",
71 | "description": "Work in progress.",
72 | "name": "wip"
73 | },
74 | {
75 | "emoji": "🛠",
76 | "code": ":build:",
77 | "description": "Add or update build-related files or scripts.",
78 | "name": "build"
79 | },
80 | {
81 | "emoji": "📦",
82 | "code": ":package:",
83 | "description": "Add or update compiled files or packages.",
84 | "name": "package"
85 | },
86 | {
87 | "emoji": "🔍",
88 | "code": ":sample:",
89 | "description": "Add or update sample code or examples.",
90 | "name": "sample"
91 | },
92 | {
93 | "emoji": "⏪",
94 | "code": ":revert:",
95 | "description": "Revert previous changes.",
96 | "name": "revert"
97 | },
98 | {
99 | "emoji": "👷",
100 | "code": ":ci:",
101 | "description": "Add or update Continuous Integration.",
102 | "name": "ci"
103 | }
104 | ]
105 | }
106 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | ci:
2 | autoupdate_schedule: monthly
3 |
4 | default_stages:
5 | - pre-commit
6 | exclude: >
7 | (?x)^(
8 | ^(\/|)vendor\/(.*?)$|
9 | .+\.node_modules\/.*$|
10 | .+\.external_modules.*$|
11 | .+\.terraform.*$|
12 | .+\.venv.*$|
13 | .+\.lock$|
14 | .+\.mdx$|
15 | )$
16 |
17 | repos:
18 | - repo: https://github.com/codespell-project/codespell
19 | rev: v2.3.0
20 | hooks:
21 | - id: codespell
22 | args:
23 | - --ignore-words=.ci/linters/.codespell-ignores
24 | exclude: >
25 | (?x)^(
26 | go.mod|
27 | go.sum|
28 | app/ia/datasets\/.*$|
29 | openapi.yaml|
30 | .+\.vendor\/.*$|
31 | .+\.node_modules\/.*$|
32 | .+\.sops.*$|
33 | .+\.lock$|
34 | .+\.mdx$|
35 | )$
36 | - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
37 | rev: v9.20.0
38 | hooks:
39 | - id: commitlint
40 | stages: [commit-msg]
41 | additional_dependencies: ["@hadenlabs/commitlint-config"]
42 | args:
43 | - --config=.ci/linters/.commitlintrc.json
44 | - repo: https://github.com/pre-commit/pre-commit-hooks
45 | rev: v5.0.0
46 | hooks:
47 | - id: detect-private-key
48 | files: ^(?!\.?git-crypt)
49 | exclude: >
50 | (?x)^(
51 | .+\.gitleaks.toml$|
52 | test/fixtures/keys/.*-test.*$
53 | )$
54 | - id: check-merge-conflict
55 | - id: check-added-large-files
56 | files: ^tf|-|\.(py|env|yml|yaml)$
57 | - id: check-case-conflict
58 | - id: check-json
59 | - id: check-xml
60 | - id: check-yaml
61 | args:
62 | - --allow-multiple-documents
63 | - id: check-byte-order-marker
64 | - id: check-ast
65 | - id: debug-statements
66 | - id: check-docstring-first
67 | - id: requirements-txt-fixer
68 | - id: check-symlinks
69 | - id: file-contents-sorter
70 | - id: fix-encoding-pragma
71 | - id: sort-simple-yaml
72 |
73 | - repo: https://github.com/tcort/markdown-link-check
74 | rev: v3.12.2
75 | hooks:
76 | - id: markdown-link-check
77 | args:
78 | - --config=.ci/linters/markdown-link-config.json
79 | exclude: >
80 | (?x)^(
81 | .+\.docs/env-vars.md$|
82 | docs/env-vars.md$|
83 | docs\/include\/terraform.md$|
84 | .+\.tpl.md$|
85 | )$
86 |
87 | - repo: https://github.com/hadenlabs/pre-commit-hooks
88 | rev: e50751c9323b0a03f27271c57513f5c389f6591b
89 | hooks:
90 | - id: do-not-commit
91 | - id: shellcheck
92 | exclude: >
93 | (?x)^(
94 | .+\.provision/git/hooks/prepare-commit-msg$|
95 | .+\.tpl.sh$|
96 | )$
97 | args:
98 | - --exclude=SC1072,SC1073,SC2068
99 | - id: gitleaks
100 | args:
101 | - --path=.
102 | - --repo-config-path=.ci/linters/.gitleaks.toml
103 | - --verbose
104 | - id: hadolint
105 | args:
106 | - --config=.ci/linters/.hadolint.yaml
107 |
--------------------------------------------------------------------------------
/docs/code_of_conduct.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | - Using welcoming and inclusive language
12 | - Being respectful of differing viewpoints and experiences
13 | - Gracefully accepting constructive criticism
14 | - Focusing on what is best for the community
15 | - Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | - The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | - Trolling, insulting/derogatory comments, and personal or political attacks
21 | - Public or private harassment
22 | - Publishing others\' private information, such as a physical or electronic address, without explicit permission
23 | - Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at . The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project\'s leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.4, available at [http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4/)
44 |
--------------------------------------------------------------------------------
/docs/contribute/github-flow.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | To contribute to zsh-docker project on [GitHub](https://github.com/hadenlabs/zsh-docker), We use [GitHub Flow](https://githubflow.github.io/), it means that you should branch from the main repository and contribute back by making [pull request](https://github.com/hadenlabs/zsh-docker/pulls).
12 |
13 | GitHub Flow is very lightweight (especially compared to GitFlow). This workflow uses only two kinds of branches:
14 |
15 | - Feature branch
16 | - Main branch (previously called master)
17 |
18 | The _feature_ branches are used to develop new features as well as fixes. These branches are usually created out of main.
19 |
20 | Anything in the _main_ branch is deployable. The _main_ branch is expected to be deployed regularly and is considered stable.
21 |
22 | For more information see [GitHub Flow](https://githubflow.github.io/)
23 |
24 | ## Getting started
25 |
26 | To follow the instructions in this guide and start contributing to zsh-docker project on GitHub:
27 |
28 | 1. **Fork** the repo on GitHub
29 | 2. **Clone** the project to your own machine
30 |
31 | To synchronize with the main repository, add it to the remotes:
32 |
33 | ```bash
34 | git remote add upstream https://github.com/hadenlabs/zsh-docker.git
35 | ```
36 |
37 | Now your **upstream** points to **hadenlabs/zsh-docker**.
38 |
39 | ## Branches
40 |
41 | ### master or main
42 |
43 | The master branch contains production code and it stores the official release history.
44 |
45 | ### Feature Branch
46 |
47 | Each new feature should reside in its own branch, which can be pushed to the central repository for backup/collaboration. But, instead of branching off of main, **feature branches** use develop as their parent branch.
48 |
49 | - When a feature is complete, it gets merged back into main.
50 |
51 | ## Merge requirements
52 |
53 | ### No merge conflicts
54 |
55 | Resolve any merge conflicts that may arise. If conflict occurs, a corresponding message will be displayed on the PR page on GitHub.
56 |
57 | To resolve a conflict, run the following commands.
58 |
59 | ```bash
60 | # checkout a branch you open PR from
61 | git fetch upstream # assuming upstream is hadenlabs/zsh-docker
62 | git merge upstream/merge_branch # Where merge_branch is a branch you open merge request against.
63 | # resolve merge requests
64 | git add changed_files
65 | git commit
66 | git push
67 | ```
68 |
69 | Github will automatically update your pull request.
70 |
71 | ### Testing
72 |
73 | All merge requests are automatically tested using [Github Actions](https://github.com/hadenlabs/zsh-docker/actions). In case some tests fail, fix the issues or describe why the fix cannot be done.
74 |
75 | ### Review
76 |
77 | Every pull request is reviewed by the assigned team members as per standard [Pull Request](https://opensource.com/article/19/7/create-pull-request-github). Reviewers can comment on a PR, approve it, or request changes to it. A PR can be merged when it is approved by at least two assigned reviewers and has no pending requests for changes.
78 |
79 | ## Code of Conduct
80 |
81 | Please have a look at our [Code of Conduct](../code_of_conduct.md) before you write an Issue or make a PR.
82 |
--------------------------------------------------------------------------------
/docs/contributing.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | # How To Contribute
10 |
11 | Contributions to zsh-docker are welcome.
12 |
13 | Feel free to use all of the contribution options:
14 |
15 | - Contribute to zsh-docker repositories on [GitHub](https://github.com/hadenlabs/zsh-docker). See [GitHub flow](./contribute/github-flow.md).
16 |
17 | ## Getting Started
18 |
19 | ### Development
20 |
21 | In general, MRs are welcome. We follow the typical "fork-and-pull" [Github flow](./contribute/github-flow.md).
22 |
23 | 1. **Fork** the repo on Github
24 | 2. **Clone** the project to your own machine
25 | 3. **Commit** changes to your own branch using [Github Flow](./contribute/github-flow.md)
26 | 4. **Push** your work back up to your fork
27 |
28 | 5. Submit a **Pull Request** so that we can review your changes
29 |
30 | **NOTE:** Be sure to rebase the latest changes from "upstream" before making a pull request!
31 |
32 | ## Styleguides
33 |
34 | ### Git Commit Messages
35 |
36 | Your commit messages should serve these 3 important purposes:
37 |
38 | - To speed up the reviewing process.
39 | - To provide the least amount of necessary documentation
40 | - To help the future maintainers.
41 |
42 | Follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0) to make `git log`{.interpreted-text role="command"} a little easier to follow. We use commitlint enforcing conventional commits (See more [here](https://github.com/conventional-changelog/commitlint))
43 |
44 | **chore**: something just needs to happen, e.g. versioning
45 |
46 | **docs**: documentation pages in `docs/` or docstrings
47 |
48 | **feat**: new code in `./`
49 |
50 | **fix**: code improvement in `./`
51 |
52 | **refactor**: code movement in `./`
53 |
54 | **style**: aesthetic changes
55 |
56 | **test**: test case modifications in `test/`
57 |
58 | Examples commit messages:
59 |
60 | - chore: IN-698 implement model devices
61 | - docs: IN-698 implement configuration settings
62 | - feat: IN-698 create lambda function
63 | - fix: IN-698 retry upload on failure
64 | - refactor: IN-698 extract duplicate code
65 | - style: IN-698 format files python
66 | - test: IN-698 coverage around add permissions
67 |
68 | **Keep it short and simple!**
69 |
70 | ### Branches
71 |
72 | See [Github Flow](./contribute/github-flow.md).
73 |
74 | ### Documentation
75 |
76 | Documentation is a part of the zsh-docker code base. You can find the documentation files in the `doc/` subdirectory of the [main repository](https://github.com/hadenlabs/zsh-docker). This means that the contribution process is the same for both the source code and documentation.
77 |
78 | ### Testing
79 |
80 | See [Testing](./testing.md).
81 |
82 | ### Code Submission
83 |
84 | 1. See if a [Pull Request](https://github.com/hadenlabs/zsh-docker/pulls) exists
85 | - Add some comments or review the code to help it along
86 | - Don\'t be afraid to comment when logic needs clarification
87 | 2. Create a Fork and open a [Pull Request](https://github.com/hadenlabs/zsh-docker/pulls) if needed
88 |
89 | ### Code Review
90 |
91 | - Anyone can review code
92 | - Any [Pull Request](https://github.com/hadenlabs/zsh-docker/pulls) should be closed or merged within a week
93 |
94 | ### Code Acceptance
95 |
96 | Try to keep history as linear as possible using a [rebase] merge strategy.
97 |
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | # https://docs.astral.sh/uv/reference/settings/
2 | # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
3 | [project]
4 | name = "zsh-docker"
5 | description = "zsh docker"
6 | version = "0.0.0"
7 | license = "LGPL-3.0"
8 | readme = "README.md"
9 | requires-python = ">=3.9"
10 | keywords = []
11 | authors = [{ name = "Luis Mayta", email = "luis@hadenlabs.com" }]
12 | repository = "https://github.com/hadenlabs/zsh-docker"
13 |
14 | dependencies = ["boto3>=1.26.130"]
15 |
16 | [project.urls]
17 | Source = "https://github.com/hadenlabs/zsh-docker"
18 | Tracker = "https://github.com/hadenlabs/zsh-docker/-/issues"
19 |
20 | [dependency-groups]
21 |
22 | lint = ["ruff>=0.7.4", "pre-commit>=3.5.0"]
23 |
24 | types = ["loguru-mypy>=0.0.4", "mypy>=1.14.0", "types-toml>=0.10.8.7"]
25 |
26 | test = [
27 | "pytest-mock>=3.14.0",
28 | "pytest>=8.3.4",
29 | "coverage>=7.6.1",
30 | "factory-boy>=3.3.0",
31 | "faker>=22.2.0",
32 | "freezegun>=1.2.2",
33 | "mock>=5.1.0",
34 | "pyhamcrest>=2.0.4",
35 | "pytest>=7.4.0",
36 | "pytest-asyncio>=0.21.1",
37 | "pytest-cov>=4.1.0",
38 | "pytest-mock>=3.11.1",
39 | "responses>=0.23.3",
40 | ]
41 | test-integration = ["torch>=2.0.1"]
42 |
43 | lsp = ["basedpyright>=1.23.1"]
44 | dap = ["debugpy>=1.8.11"]
45 | dev = [
46 | "bump-pydantic>=0.6.1",
47 | "bump-my-version>=1.1.2",
48 | "greenlet>=2.0.2",
49 | "ipdb>=0.13.13",
50 | ]
51 | docs = [
52 | "doc8",
53 | "grip>=4.6.1",
54 | "mkdocs>=1.5.2",
55 | "mkdocs-material>=9.2.6",
56 | "pymdown-extensions>=10.2.1",
57 | ]
58 |
59 | [tool.pyright]
60 | pythonVersion = "3.11"
61 | typeCheckingMode = "basic"
62 | useLibraryCodeForTypes = true
63 | # enable subset of "strict"
64 | reportDuplicateImport = true
65 | reportInconsistentConstructor = true
66 | reportInvalidStubStatement = true
67 | reportOverlappingOverload = true
68 | reportPropertyTypeMismatch = true
69 | reportUntypedClassDecorator = true
70 | reportUntypedFunctionDecorator = true
71 | reportUntypedNamedTuple = true
72 | reportUnusedImport = true
73 | # disable subset of "basic"
74 | reportGeneralTypeIssues = false
75 | reportMissingModuleSource = false
76 | reportOptionalCall = false
77 | reportOptionalIterable = false
78 | reportOptionalMemberAccess = false
79 | reportOptionalOperand = false
80 | reportOptionalSubscript = false
81 | reportPrivateImportUsage = false
82 | reportUnboundVariable = false
83 |
84 | [tool.ruff]
85 | src = ["src", "tests"]
86 | line-length = 90 # black default
87 |
88 | [tool.ruff.lint]
89 | select = [
90 | "E", # pycodestyle (supersedes pep8)
91 | "W", # pycodestyle warnings
92 | # "D", # pydocstyle
93 | "F", # pyflakes
94 | # "UP", # pyupgrade
95 | "S", # flake8-bandit
96 | "B", # flake8-bugbear
97 | "I", # isort
98 | "N", # pep8-naming
99 | # "ERA", # eradicate
100 | "C4", # flake8-comprehensions
101 | "A", # flake8-builtins
102 | "Q", # flake8-quotes
103 | "YTT", # flake8-2020
104 | # "ANN", # flake8-annotations
105 | "BLE", # flake8-blind-except
106 | # "FBT", # flake8-boolean-trap
107 | "C90", # mccabe
108 | "T10", # flake8-debugger
109 | # "EM", # flake8-errmsg
110 | "ICN", # flake8-import-conventions
111 | # "T20", # flake8-print
112 | # "RET", # flake8-return
113 | "SIM", # flake8-simplify
114 | "TID", # flake8-tidy-imports
115 | # "ARG", # flake8-unused-arguments
116 | "PGH", # pygrep-hooks
117 | "PLC", # pylint
118 | "PLE", # pylint
119 | "PLR", # pylint
120 | "PLW", # pylint
121 | "RUF", # ruff-specific rules
122 | ]
123 | ignore = []
124 |
125 | [tool.ruff.lint.per-file-ignores]
126 | "tests/*" = [
127 | "S101", # assert used
128 | "S105", # hardcoded password
129 | ]
130 |
131 | [tool.basedpyright]
132 | pythonVersion = "3.11"
133 | venvPath = ".venv"
134 |
135 | [tool.mypy]
136 | python_version = "3.11"
137 | ignore_missing_imports = "True"
138 | disallow_untyped_defs = "True"
139 | exclude = ["notebooks"]
140 | strict = true
141 |
142 | [[tool.mypy.overrides]]
143 | module = ["dotty_dict.*", "pip_requirements_parser.*", "tomli.*"]
144 | ignore_missing_imports = true
145 |
146 | [tool.coverage.run]
147 | omit = ["tests/*"]
148 |
149 | [tool.bumpversion]
150 | current_version = "0.0.0"
151 | parse = '''
152 | (?P\d+)\.(?P\d+)\.(?P\d+)
153 | (?:-(?P(alpha|beta|rc))\.(?P\d+))?
154 | '''
155 | serialize = [
156 | "{major}.{minor}.{patch}-{pre_release}.{pre_release_number}",
157 | "{major}.{minor}.{patch}",
158 | ]
159 | search = "{current_version}"
160 | replace = "{new_version}"
161 | regex = false
162 | ignore_missing_version = false
163 | tag = false
164 | sign_tags = false
165 | tag_name = "v{new_version}"
166 | tag_message = "Bump version: {current_version} → {new_version}"
167 | allow_dirty = false
168 | commit = false
169 | message = "Bump version: {current_version} → {new_version}"
170 | commit_args = ""
171 |
172 | [[tool.bumpversion.files]]
173 | filename = "sonar-project.properties"
174 | search = 'sonar.projectVersion={current_version}'
175 | replace = 'sonar.projectVersion={new_version}'
176 |
--------------------------------------------------------------------------------
/.ci/linters/.golangci.yml:
--------------------------------------------------------------------------------
1 | run:
2 | timeout: 10m
3 | deadline: 5m
4 |
5 | tests: true
6 |
7 | output:
8 | formats: tab
9 |
10 | linters-settings:
11 | gofmt:
12 | # simplify code: gofmt with `-s` option, true by default
13 | simplify: true
14 |
15 | goimports:
16 | # put imports beginning with prefix after 3rd-party packages;
17 | # it's a comma-separated list of prefixes
18 | local-prefixes: github.com/hadenlabs/
19 |
20 | gocyclo:
21 | # minimal code complexity to report, 30 by default (but we recommend 10-20)
22 | min-complexity: 10
23 |
24 | dupl:
25 | # tokens count to trigger issue, 150 by default
26 | threshold: 100
27 |
28 | goconst:
29 | # minimal length of string constant, 3 by default
30 | min-len: 3
31 | # minimal occurrences count to trigger, 3 by default
32 | min-occurrences: 5
33 |
34 | lll:
35 | # tab width in spaces. Default to 1.
36 | tab-width: 1
37 |
38 | unused:
39 | # treat code as a program (not a library) and report unused exported identifiers; default is false.
40 | # XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
41 | # if it's called for subdir of a project it can't find funcs usages. All text editor integrations
42 | # with golangci-lint call it on a directory with the changed file.
43 | check-exported: false
44 |
45 | unparam:
46 | # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
47 | # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
48 | # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
49 | # with golangci-lint call it on a directory with the changed file.
50 | check-exported: false
51 |
52 | nakedret:
53 | # make an issue if func has more lines of code than this setting and it has naked returns; default is 30
54 | max-func-lines: 30
55 |
56 | prealloc:
57 | # XXX: we don't recommend using this linter before doing performance profiling.
58 | # For most programs usage of prealloc will be a premature optimization.
59 |
60 | # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
61 | # True by default.
62 | simple: true
63 | range-loops: true # Report preallocation suggestions on range loops, true by default
64 | for-loops: false # Report preallocation suggestions on for loops, false by default
65 |
66 | gocritic:
67 | # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
68 | # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
69 | enabled-tags:
70 | - performance
71 |
72 | settings: # settings passed to gocritic
73 | captLocal: # must be valid enabled check name
74 | paramsOnly: true
75 | rangeValCopy:
76 | sizeThreshold: 32
77 |
78 | misspell:
79 | locale: US
80 |
81 | linters:
82 | enable:
83 | - govet
84 | - gocyclo
85 | - gocritic
86 | - goconst
87 | - goimports
88 | - gofmt # We enable this as well as goimports for its simplify mode.
89 | - prealloc
90 | - unconvert
91 | - misspell
92 | - nakedret
93 | - unused
94 |
95 | presets:
96 | - bugs
97 | - unused
98 | fast: false
99 | disable:
100 | - funlen
101 | - wsl
102 | - testpackage
103 | - bodyclose
104 | - contextcheck
105 | - nilerr
106 | - noctx
107 | - rowserrcheck
108 | - sqlclosecheck
109 | - unparam
110 | - asasalint
111 |
112 | # Drives todos nuts
113 | - godox
114 |
115 | issues:
116 | # Excluding configuration per-path and per-linter
117 | exclude-rules:
118 | # Exclude some linters from running on tests files.
119 | - path: _test(ing)?\.go
120 | linters:
121 | - gocyclo
122 | - errcheck
123 | - dupl
124 | - gosec
125 | - unparam
126 | - scopelint
127 | - goanalysis_metalinter
128 | - structcheck
129 |
130 | # Independently from option `exclude` we use default exclude patterns,
131 | # it can be disabled by this option. To list all
132 | # excluded by default patterns execute `golangci-lint run --help`.
133 | # Default value for this option is true.
134 | exclude-use-default: false
135 |
136 | # Show only new issues: if there are unstaged changes or untracked files,
137 | # only those changes are analyzed, else only changes in HEAD~ are analyzed.
138 | # It's a super-useful option for integration of golangci-lint into existing
139 | # large codebase. It's not practical to fix all existing issues at the moment
140 | # of integration: much better don't allow issues in new code.
141 | # Default is false.
142 | new: false
143 |
144 | # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
145 | max-per-linter: 0
146 |
147 | # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
148 | max-same-issues: 0
149 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
14 |
15 | [](https://github.com/hadenlabs/zsh-docker/releases) [](https://github.com/hadenlabs/zsh-docker/actions?workflow=lint-code) [](https://github.com/hadenlabs/zsh-docker/actions?workflow=ci) [](https://github.com/hadenlabs/zsh-docker/actions?workflow=test) [](https://github.com/pre-commit/pre-commit) [](https://conventionalcommits.org) [](https://keepachangelog.com)
16 |
17 | # zsh-docker
18 |
19 | zsh-docker for project
20 |
21 | ## Requirements
22 |
23 | This is a list of plugins that need to be installed previously to enjoy all the goodies of this configuration:
24 |
25 | - [zsh-core](https://github.com/hadenlabs/zsh-core)
26 | - [gomplate](https://github.com/hairyhenderson/gomplate)
27 | - [python](https://www.python.org)
28 | - [taskfile](https://github.com/go-task/task)
29 |
30 | ## Installation
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | ### [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) users
43 |
44 | If you're using [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh), install this plugin by doing the following:
45 |
46 | 1. Go to your oh-my-zsh custom plugins directory -`cd ~/.oh-my-zsh/custom/plugins`
47 | 2. Clone the plugin `bash git clone https://github.com/hadenlabs/zsh-docker`bash
48 | 3. Edit your `.zshrc` and add `plugins=( ... zsh-docker )` to your list of plugins
49 | 4. Open a new terminal and enjoy!
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | ### [antigen](https://github.com/zsh-users/antigen) users
61 |
62 | If you're using [Antigen](https://github.com/zsh-users/antigen), install this plugin by doing the following:
63 |
64 | 1. Add `antigen bundle hadenlabs/zsh-docker` to your `.zshrc` where you're adding your other plugins.
65 | 2. Either open a new terminal to force zsh to load the new plugin, or run `antigen bundle hadenlabs/zsh-docker` in a running zsh session.
66 | 3. Enjoy!
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | ### [antibody](https://github.com/getantibody/antibody) users
77 |
78 | If you're using [Antibody](https://github.com/getantibody/antibody), install this plugin by doing the following:
79 |
80 | 1. Add :
81 |
82 | ```{.sourceCode .bash}
83 | antibody bundle hadenlabs/zsh-docker
84 | ```
85 |
86 | to your `.zshrc` where you're adding your other plugins.
87 |
88 | 2. Either open a new terminal to force zsh to load the new plugin, or run `antibody bundle hadenlabs/zsh-docker` in a running zsh session.
89 | 3. Enjoy!
90 |
91 | ## Usage
92 |
93 | # 🚀 How to use this project
94 |
95 | ```bash
96 | task setup
97 | ```
98 |
99 | ## Examples
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | ## Common
109 |
110 | ### Install Dependencies
111 |
112 | ```bash
113 | task setup
114 | ```
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 | ## Functions
124 |
125 | ## Help
126 |
127 | ### Got a question?
128 |
129 | File a GitHub [issue](https://github.com/hadenlabs/zsh-docker/issues).
130 |
131 | ## Contributing
132 |
133 | See [Contributing](./docs/contributing.md).
134 |
135 | ## Module Versioning
136 |
137 | This Module follows the principles of [Semantic Versioning (SemVer)](https://semver.org/).
138 |
139 | Using the given version number of `MAJOR.MINOR.PATCH`, we apply the following constructs:
140 |
141 | 1. Use the `MAJOR` version for incompatible changes.
142 | 1. Use the `MINOR` version when adding functionality in a backwards compatible manner.
143 | 1. Use the `PATCH` version when introducing backwards compatible bug fixes.
144 |
145 | ### Backwards compatibility in `0.0.z` and `0.y.z` version
146 |
147 | - In the context of initial development, backwards compatibility in versions `0.0.z` is **not guaranteed** when `z` is increased. (Initial development)
148 | - In the context of pre-release, backwards compatibility in versions `0.y.z` is **not guaranteed** when `y` is increased. (Pre-release)
149 |
150 | ## Copyright
151 |
152 | Copyright © 2018-2025 [Hadenlabs](https://hadenlabs.com)
153 |
154 | ## Trademarks
155 |
156 | All other trademarks referenced herein are the property of their respective owners.
157 |
158 | ## License
159 |
160 | The code and styles are licensed under the LGPL-3.0 license [See project license.](LICENSE).
161 |
162 | ## Don't forget to 🌟 Star 🌟 the repo if you like zsh-docker
163 |
164 | [Your feedback is appreciated](https://github.com/hadenlabs/zsh-docker/issues)
165 |
--------------------------------------------------------------------------------
/Taskfile.yml:
--------------------------------------------------------------------------------
1 | ---
2 | version: "3"
3 |
4 | includes:
5 | pre-commit:
6 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/pre-commit/Taskfile.yml"
7 | changelog:
8 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/changelog/Taskfile.yml"
9 | confluence:
10 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/confluence/Taskfile.yml"
11 | node:
12 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/node/Taskfile.yml"
13 | python:
14 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/python/Taskfile.yml"
15 | uv:
16 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/uv/Taskfile.yml"
17 | pnpm:
18 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/pnpm/Taskfile.yml"
19 | go:
20 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/go/Taskfile.yml"
21 | gradle:
22 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/gradle/Taskfile.yml"
23 | coursier:
24 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/coursier/Taskfile.yml"
25 | git:
26 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/git/Taskfile.yml"
27 | docs:
28 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/docs/Taskfile.yml"
29 | docker:
30 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/docker/Taskfile.yml"
31 | version:
32 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/version/Taskfile.yml"
33 | plantuml:
34 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/plantuml/Taskfile.yml"
35 | prettier:
36 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/prettier/Taskfile.yml"
37 | sonar:
38 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/sonar/Taskfile.yml"
39 | keybase:
40 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/keybase/Taskfile.yml"
41 | multipass:
42 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/multipass/Taskfile.yml"
43 | ssh:
44 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/ssh/Taskfile.yml"
45 | openssl:
46 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/openssl/Taskfile.yml"
47 | terraform:
48 | taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/refs/heads/main/src/terraform/Taskfile.yml"
49 |
50 | env:
51 | DOCKER:
52 | sh: docker --version 2> /dev/null || echo "not exist"
53 | PYTHON:
54 | sh: python --version 2> /dev/null || echo "not exist"
55 | GO:
56 | sh: go version 2> /dev/null || echo "not exist"
57 | NODE:
58 | sh: node --version 2> /dev/null || echo "not exist"
59 | APP_TAG:
60 | sh: git describe --tags $(git rev-list --tags --max-count=1) 2> /dev/null || echo "0.0.0"
61 | README_YAML: provision/generators/README.yaml
62 | README_TEMPLATE: provision/templates/README.tpl.md
63 | README_INCLUDES: file://
64 | TERRAFORM_PATH: ./
65 | PYTHON_PACKAGE_MANAGER: uv
66 |
67 | dotenv:
68 | - .env
69 |
70 | vars:
71 | PROJECT_NAME: zsh-docker
72 | ORGANIZATION: hadenlabs
73 | USER: ubuntu
74 | DOCKER_PLATFORM: linux/amd64
75 | REVIEWERS: luismayta
76 | PYTHON_VERSION: 3.11.5
77 | NODE_VERSION: v20.9.0
78 | GRADLE_VERSION: 8.4.0
79 | GOLANG_VERSION: 1.22.4
80 | GIT_IGNORES: python,node,go,zsh,sonar,java,maven,intellij+all,terraform,linux
81 | GOLANGCI_VERSION: 1.42.0
82 | TERRAFORM_VERSION: 1.11.4
83 | README_FILE: README.md
84 | GIT_IGNORES_CUSTOM: |
85 | bin
86 | .project
87 | .scannerwork
88 | .secrets
89 | public
90 | TMP_CHANGELOG.md
91 | .task
92 | .terraform.lock.hcl
93 | build
94 | .task
95 | *.lock
96 | *.lock.hcl
97 | .cq/
98 | *.lock
99 | *.zip
100 | *.iml
101 | .external_modules
102 | .pmd
103 | vendor
104 | !uv.lock
105 |
106 | tasks:
107 | default:
108 | deps:
109 | - task: check
110 | cmds:
111 | - cmd: echo Application {{.PROJECT_NAME}}
112 | silent: true
113 | - task: version:default
114 | - task: summary
115 | - cmd: task -l
116 | silent: true
117 |
118 | summary:
119 | desc: "Summary information"
120 | cmds:
121 | - echo Go available {{.GO}}
122 | - echo Python available {{.PYTHON}}
123 | - echo Docker available {{.DOCKER}}
124 | - echo Node available {{.NODE}}
125 | silent: true
126 |
127 | check:
128 | desc: "Check all dependencies"
129 | deps:
130 | - uv:check
131 | - pnpm:check
132 | - changelog:check
133 | - git:check
134 | - docs:check
135 |
136 | readme:
137 | run: once
138 | desc: Generate Readme
139 | silent: true
140 | cmds:
141 | - >-
142 | gomplate --file {{.README_TEMPLATE}}
143 | --out {{.README_FILE}}
144 | --datasource config={{.README_YAML}}
145 | --datasource includes={{.README_INCLUDES}}
146 | - task: prettier
147 |
148 | prettier:
149 | run: once
150 | desc: Execute prettier files
151 | cmds:
152 | - task: prettier:all
153 | - task: uv:fmt
154 |
155 | test:
156 | desc: Execute of test
157 | cmds:
158 | - task: go:test
159 |
160 | upgrade:
161 | run: once
162 | desc: Execute upgrade packages
163 | cmds:
164 | - uv update
165 | - uv run pre-commit autoupdate
166 |
167 | setup:
168 | desc: Setup dependences of project
169 | cmds:
170 | - >-
171 | [ -e ".env" ] || cp -rf .env.example .env
172 | - task: uv:setup
173 | - task: uv:precommit
174 | - task: git:setup
175 |
176 | environment:
177 | desc: Setup environment of project
178 | cmds:
179 | - task: uv:environment
180 |
181 | help:
182 | cmds:
183 | - cmd: |
184 | echo 'Use "task --list" to get a list of all available tasks with a short description of what they do.'
185 | echo 'There are some more tasks used as dependencies for other tasks.'
186 | echo 'You can view them with "task --list-all".'
187 | silent: true
188 |
--------------------------------------------------------------------------------
/provision/templates/README.tpl.md:
--------------------------------------------------------------------------------
1 | {{ defineDatasource "config" .Env.README_YAML | regexp.Replace ".*" "" -}} {{ defineDatasource "includes" .Env.README_INCLUDES | regexp.Replace ".*" "" -}}
2 | {{ if has (ds "config") "confluence" }}{{ $confluence := (ds "config").confluence -}}
3 | {{- if has $confluence "space" }} {{ end }}
4 | {{ if has $confluence "parent" }} {{- end -}}
5 | {{ if has $confluence "title" -}} {{ end }}
6 | {{ if has $confluence "images" -}}
7 | {{ range $image := $confluence.images -}}
8 |
9 | {{ end }}
10 | {{ end }}
11 | {{- end }}
12 |
13 |
14 |
27 |
28 |
29 | {{ if has (ds "config") "badges" }}{{- range $badge := (ds "config").badges -}}{{ printf " [](%s)" $badge.name $badge.image $badge.url }}{{ end }}{{ end }}
30 |
31 | # {{(ds "config").name}}{{ if gt (len (ds "config").name) 34 }}{{ print "\n\n" }}{{ end }}
32 |
33 | {{ if has (ds "config") "logo" -}} .logo }}) {{ end }}
34 |
35 | {{ if has (ds "config") "description" -}} {{(ds "config").description }} {{ end }}
36 |
37 | {{ if has (ds "config") "screenshots" }}
38 |
39 | ## Screenshots
40 |
41 | {{ range $screenshot := (ds "config").screenshots }}
42 | {{ printf "\n*%s*" $screenshot.name $screenshot.url $screenshot.description }}
43 | {{ end }}{{ end }}
44 |
45 | {{ if has (ds "config") "features" }}
46 |
47 | ## Features
48 |
49 | {{ range $feature := (ds "config").features }}{{printf "- %s\n" $feature}}{{ end }}
50 |
51 | {{ end }}
52 |
53 | {{ if has (ds "config") "modules" }}
54 |
55 | ## Modules
56 |
57 | {{ range $module := (ds "config").modules }}{{printf "- %s\n" $module}}{{ end }} {{ end }}
58 |
59 | {{ if has (ds "config") "introduction" }}
60 |
61 | ## Introduction
62 |
63 | {{ (ds "config").introduction -}} {{ end }}
64 |
65 | {{ if has (ds "config") "todo" }}
66 |
67 | ## TODO
68 |
69 | {{ range $todo := (ds "config").todo }}
70 | {{ printf "* [%s](%s)" $todo.name $todo.url }}
71 | {{ end }}
72 | {{ end }}
73 |
74 | {{ if has (ds "config") "requirements" }}
75 |
76 | ## Requirements
77 |
78 | {{ (ds "config").requirements -}} {{ end }}
79 |
80 | {{ if has (ds "config") "installation" }}
81 |
82 | ## Installation
83 |
84 | {{ range $file := (datasource "config").installation -}}
85 | {{ (include "includes" $file) }}
86 | {{- end }}
87 | {{- end }}
88 |
89 | {{ if has (ds "config") "usages" }}
90 |
91 | ## Usage
92 |
93 | {{ range $file := (datasource "config").usages -}}
94 | {{ (include "includes" $file) }}
95 | {{- end }}
96 | {{ end }}
97 |
98 | {{ if has (ds "config") "quickstart" -}}
99 |
100 | ## Quick Start
101 |
102 | {{ (ds "config").quickstart -}} {{ end }}
103 |
104 | {{ if has (ds "config") "examples" }}
105 |
106 | ## Examples
107 |
108 | {{ range $file := (datasource "config").examples -}}
109 | {{ (include "includes" $file) }}
110 | {{- end }}
111 | {{ end }}
112 |
113 | {{ if has (ds "config") "include" }} {{ range $file := (datasource "config").include -}} {{ (include "includes" $file) }} {{- end }} {{- end }}
114 |
115 | {{ if has (ds "config") "related" }}
116 |
117 | ## Related Projects
118 |
119 | Check out these related projects.
120 | {{ range $related := (ds "config").related }}
121 | {{ printf "* [%s](%s) - %s" $related.name $related.url $related.description }}
122 | {{ end }}
123 |
124 | {{ end}}
125 |
126 | {{ if has (ds "config") "references" }}
127 |
128 | ## References
129 |
130 | For additional context, refer to some of these links.
131 | {{ range $reference := (ds "config").references }}
132 | {{ printf "* [%s](%s) - %s" $reference.name $reference.url $reference.description }}
133 | {{ end }}
134 | {{ end}}
135 |
136 | ## Help
137 |
138 | ### Got a question?
139 |
140 | {{ if has (ds "config") "github_repo" }}
141 | File a GitHub [issue]({{ printf "https://github.com/%s/issues" (ds "config").github_repo}}).
142 | {{ else if has (ds "config") "gitlab_host" }}
143 | File a GitLab [issue]({{ printf "https://%s/%s/-/issues" (ds "config").gitlab_host (ds "config").gitlab_repo}}).
144 | {{ else if has (ds "config") "gitlab_repo" }}
145 | File a GitLab [issue]({{ printf "https://gitlab.com/%s/-/issues" (ds "config").gitlab_repo}}).
146 | {{ end }}
147 |
148 | ## Contributing
149 |
150 | See [Contributing](./docs/contributing.md).
151 |
152 | ## Module Versioning
153 |
154 | This Module follows the principles of [Semantic Versioning (SemVer)](https://semver.org/).
155 |
156 | Using the given version number of `MAJOR.MINOR.PATCH`, we apply the following constructs:
157 |
158 | 1. Use the `MAJOR` version for incompatible changes.
159 | 1. Use the `MINOR` version when adding functionality in a backwards compatible manner.
160 | 1. Use the `PATCH` version when introducing backwards compatible bug fixes.
161 |
162 | ### Backwards compatibility in `0.0.z` and `0.y.z` version
163 |
164 | - In the context of initial development, backwards compatibility in versions `0.0.z` is **not guaranteed** when `z` is
165 | increased. (Initial development)
166 | - In the context of pre-release, backwards compatibility in versions `0.y.z` is **not guaranteed** when `y` is
167 | increased. (Pre-release)
168 |
169 |
170 | {{ if has (ds "config") "copyrights" }}
171 |
172 | ## Copyrights
173 |
174 | {{ range $copyright := (ds "config").copyrights -}} {{ printf "Copyright © %s-%d [%s](%s)\n" $copyright.year time.Now.Year $copyright.name $copyright.url }} {{ end }}
175 |
176 | {{ else }}
177 |
178 | ## Copyright
179 |
180 | Copyright © 2018-{{ time.Now.Year }} [Hadenlabs](https://hadenlabs.com)
181 | {{ end}}
182 |
183 |
184 | ## Trademarks
185 |
186 | All other trademarks referenced herein are the property of their respective owners.
187 |
188 | {{ if has (datasource "config") "contributors" }}
189 |
190 | ### :star: Contributors
191 |
192 | | {{ range $contributor := (ds "config").contributors }}{{ printf " [![%s][%s_avatar]][%s_homepage]
[%s][%s_homepage] |" $contributor.name $contributor.github $contributor.github $contributor.name $contributor.github}}{{ end }}
193 | |{{- range $contributor := (ds "config").contributors -}}---|{{ end }}
194 |
195 | {{ range $contributor := (ds "config").contributors -}}
196 | {{- if has $contributor "homepage" }}
197 | {{ printf " [%s_homepage]: %s" $contributor.github $contributor.homepage }}
198 | {{ else -}}
199 | {{ printf " [%s_homepage]: https://github.com/%s" $contributor.github $contributor.github }}
200 | {{ end -}}
201 | {{ if has $contributor "avatar" }}
202 | {{ printf " [%s_avatar]: %s" $contributor.github $contributor.avatar }}
203 | {{ else -}}
204 | {{ printf " [%s_avatar]: https://github.com/%s.png?size=150" $contributor.github $contributor.github }}
205 | {{- end }}
206 | {{ end }}
207 |
208 | {{ end }}
209 |
210 |
211 | {{ if has (ds "config") "license" }}
212 |
213 | ## License
214 |
215 | The code and styles are licensed under the {{(ds "config").license }} license [See project license.](LICENSE).
216 |
217 | {{ end }}
218 |
219 | ## Don't forget to 🌟 Star 🌟 the repo if you like {{(ds "config").name}}
220 |
221 | {{ if has (ds "config") "github_repo" }}
222 | [Your feedback is appreciated]({{ printf "https://github.com/%s/issues" (ds "config").github_repo}})
223 | {{ else if has (ds "config") "gitlab_host" }}
224 | [Your feedback is appreciated]({{ printf "https://%s/%s/-/issues" (ds "config").gitlab_host (ds "config").gitlab_repo}})
225 | {{ else if has (ds "config") "gitlab_repo" }}
226 | [Your feedback is appreciated]({{ printf "https://gitlab.com/%s/-/issues" (ds "config").gitlab_repo}})
227 | {{ end }}
228 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 |
9 | This version of the GNU Lesser General Public License incorporates
10 | the terms and conditions of version 3 of the GNU General Public
11 | License, supplemented by the additional permissions listed below.
12 |
13 | 0. Additional Definitions.
14 |
15 | As used herein, "this License" refers to version 3 of the GNU Lesser
16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU
17 | General Public License.
18 |
19 | "The Library" refers to a covered work governed by this License,
20 | other than an Application or a Combined Work as defined below.
21 |
22 | An "Application" is any work that makes use of an interface provided
23 | by the Library, but which is not otherwise based on the Library.
24 | Defining a subclass of a class defined by the Library is deemed a mode
25 | of using an interface provided by the Library.
26 |
27 | A "Combined Work" is a work produced by combining or linking an
28 | Application with the Library. The particular version of the Library
29 | with which the Combined Work was made is also called the "Linked
30 | Version".
31 |
32 | The "Minimal Corresponding Source" for a Combined Work means the
33 | Corresponding Source for the Combined Work, excluding any source code
34 | for portions of the Combined Work that, considered in isolation, are
35 | based on the Application, and not on the Linked Version.
36 |
37 | The "Corresponding Application Code" for a Combined Work means the
38 | object code and/or source code for the Application, including any data
39 | and utility programs needed for reproducing the Combined Work from the
40 | Application, but excluding the System Libraries of the Combined Work.
41 |
42 | 1. Exception to Section 3 of the GNU GPL.
43 |
44 | You may convey a covered work under sections 3 and 4 of this License
45 | without being bound by section 3 of the GNU GPL.
46 |
47 | 2. Conveying Modified Versions.
48 |
49 | If you modify a copy of the Library, and, in your modifications, a
50 | facility refers to a function or data to be supplied by an Application
51 | that uses the facility (other than as an argument passed when the
52 | facility is invoked), then you may convey a copy of the modified
53 | version:
54 |
55 | a) under this License, provided that you make a good faith effort to
56 | ensure that, in the event an Application does not supply the
57 | function or data, the facility still operates, and performs
58 | whatever part of its purpose remains meaningful, or
59 |
60 | b) under the GNU GPL, with none of the additional permissions of
61 | this License applicable to that copy.
62 |
63 | 3. Object Code Incorporating Material from Library Header Files.
64 |
65 | The object code form of an Application may incorporate material from
66 | a header file that is part of the Library. You may convey such object
67 | code under terms of your choice, provided that, if the incorporated
68 | material is not limited to numerical parameters, data structure
69 | layouts and accessors, or small macros, inline functions and templates
70 | (ten or fewer lines in length), you do both of the following:
71 |
72 | a) Give prominent notice with each copy of the object code that the
73 | Library is used in it and that the Library and its use are
74 | covered by this License.
75 |
76 | b) Accompany the object code with a copy of the GNU GPL and this license
77 | document.
78 |
79 | 4. Combined Works.
80 |
81 | You may convey a Combined Work under terms of your choice that,
82 | taken together, effectively do not restrict modification of the
83 | portions of the Library contained in the Combined Work and reverse
84 | engineering for debugging such modifications, if you also do each of
85 | the following:
86 |
87 | a) Give prominent notice with each copy of the Combined Work that
88 | the Library is used in it and that the Library and its use are
89 | covered by this License.
90 |
91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 | document.
93 |
94 | c) For a Combined Work that displays copyright notices during
95 | execution, include the copyright notice for the Library among
96 | these notices, as well as a reference directing the user to the
97 | copies of the GNU GPL and this license document.
98 |
99 | d) Do one of the following:
100 |
101 | 0) Convey the Minimal Corresponding Source under the terms of this
102 | License, and the Corresponding Application Code in a form
103 | suitable for, and under terms that permit, the user to
104 | recombine or relink the Application with a modified version of
105 | the Linked Version to produce a modified Combined Work, in the
106 | manner specified by section 6 of the GNU GPL for conveying
107 | Corresponding Source.
108 |
109 | 1) Use a suitable shared library mechanism for linking with the
110 | Library. A suitable mechanism is one that (a) uses at run time
111 | a copy of the Library already present on the user's computer
112 | system, and (b) will operate properly with a modified version
113 | of the Library that is interface-compatible with the Linked
114 | Version.
115 |
116 | e) Provide Installation Information, but only if you would otherwise
117 | be required to provide such information under section 6 of the
118 | GNU GPL, and only to the extent that such information is
119 | necessary to install and execute a modified version of the
120 | Combined Work produced by recombining or relinking the
121 | Application with a modified version of the Linked Version. (If
122 | you use option 4d0, the Installation Information must accompany
123 | the Minimal Corresponding Source and Corresponding Application
124 | Code. If you use option 4d1, you must provide the Installation
125 | Information in the manner specified by section 6 of the GNU GPL
126 | for conveying Corresponding Source.)
127 |
128 | 5. Combined Libraries.
129 |
130 | You may place library facilities that are a work based on the
131 | Library side by side in a single library together with other library
132 | facilities that are not Applications and are not covered by this
133 | License, and convey such a combined library under terms of your
134 | choice, if you do both of the following:
135 |
136 | a) Accompany the combined library with a copy of the same work based
137 | on the Library, uncombined with any other library facilities,
138 | conveyed under the terms of this License.
139 |
140 | b) Give prominent notice with the combined library that part of it
141 | is a work based on the Library, and explaining where to find the
142 | accompanying uncombined form of the same work.
143 |
144 | 6. Revised Versions of the GNU Lesser General Public License.
145 |
146 | The Free Software Foundation may publish revised and/or new versions
147 | of the GNU Lesser General Public License from time to time. Such new
148 | versions will be similar in spirit to the present version, but may
149 | differ in detail to address new problems or concerns.
150 |
151 | Each version is given a distinguishing version number. If the
152 | Library as you received it specifies that a certain numbered version
153 | of the GNU Lesser General Public License "or any later version"
154 | applies to it, you have the option of following the terms and
155 | conditions either of that published version or of any later version
156 | published by the Free Software Foundation. If the Library as you
157 | received it does not specify a version number of the GNU Lesser
158 | General Public License, you may choose any version of the GNU Lesser
159 | General Public License ever published by the Free Software Foundation.
160 |
161 | If the Library as you received it specifies that a proxy can decide
162 | whether future versions of the GNU Lesser General Public License shall
163 | apply, that proxy's public statement of acceptance of any version is
164 | permanent authorization for you to choose that version for the
165 | Library.
166 |
--------------------------------------------------------------------------------
/.ci/linters/.gitleaks.toml:
--------------------------------------------------------------------------------
1 | title = "gitleaks config"
2 |
3 | [[rules]]
4 | description = "AWS Access Key"
5 | regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
6 | tags = ["key", "AWS"]
7 | [rules.allowlist]
8 | description = "ignore value fake"
9 | regexes = [
10 | '''AIDAQEAAAAAAAAAAAAAA''',
11 | ]
12 |
13 | [[rules]]
14 | description = "AWS cred file info"
15 | regex = '''(?i)(aws_access_key_id|aws_secret_access_key)(.{0,20})?=.[0-9a-zA-Z\/+]{20,40}'''
16 | tags = ["AWS"]
17 |
18 | [[rules]]
19 | description = "AWS Secret Key"
20 | regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]'''
21 | tags = ["key", "AWS"]
22 |
23 | [[rules]]
24 | description = "AWS MWS key"
25 | regex = '''amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'''
26 | tags = ["key", "AWS", "MWS"]
27 |
28 | [[rules]]
29 | description = "Facebook Secret Key"
30 | regex = '''(?i)(facebook|fb)(.{0,20})?(?-i)['\"][0-9a-f]{32}['\"]'''
31 | tags = ["key", "Facebook"]
32 |
33 | [[rules]]
34 | description = "Facebook Client ID"
35 | regex = '''(?i)(facebook|fb)(.{0,20})?['\"][0-9]{13,17}['\"]'''
36 | tags = ["key", "Facebook"]
37 |
38 | [[rules]]
39 | description = "Facebook access token"
40 | regex = '''EAACEdEose0cBA[0-9A-Za-z]+'''
41 | tags = ["key", "Facebook"]
42 |
43 | [[rules]]
44 | description = "Twitter Secret Key"
45 | regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{35,44}['\"]'''
46 | tags = ["key", "Twitter"]
47 |
48 | [[rules]]
49 | description = "Twitter Client ID"
50 |
51 | regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{18,25}['\"]'''
52 | tags = ["client", "Twitter"]
53 |
54 | [[rules]]
55 | description = "Github"
56 | regex = '''(?i)github(.{0,20})?(?-i)['\"][0-9a-zA-Z]{35,40}['\"]'''
57 | tags = ["key", "Github"]
58 |
59 | [[rules]]
60 | description = "LinkedIn Client ID"
61 | regex = '''(?i)linkedin(.{0,20})?(?-i)['\"][0-9a-z]{12}['\"]'''
62 | tags = ["client", "LinkedIn"]
63 |
64 | [[rules]]
65 | description = "LinkedIn Secret Key"
66 | regex = '''(?i)linkedin(.{0,20})?['\"][0-9a-z]{16}['\"]'''
67 | tags = ["secret", "LinkedIn"]
68 |
69 | [[rules]]
70 | description = "Slack"
71 | regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})?'''
72 | tags = ["key", "Slack"]
73 |
74 | [[rules]]
75 | description = "EC"
76 | regex = '''-----BEGIN EC PRIVATE KEY-----'''
77 | tags = ["key", "EC"]
78 |
79 | [[rules]]
80 | description = "Google API key"
81 | regex = '''AIza[0-9A-Za-z\\-_]{35}'''
82 | tags = ["key", "Google"]
83 |
84 | [[rules]]
85 | description = "Google Cloud Platform API key"
86 | regex = '''(?i)(google|gcp|youtube|drive|yt)(.{0,20})?['\"][AIza[0-9a-z\\-_]{35}]['\"]'''
87 | tags = ["key", "Google", "GCP"]
88 |
89 | [[rules]]
90 | description = "Google OAuth"
91 | regex = '''(?i)(google|gcp|auth)(.{0,20})?['"][0-9]+-[0-9a-z_]{32}\.apps\.googleusercontent\.com['"]'''
92 | tags = ["key", "Google", "OAuth"]
93 |
94 | [[rules]]
95 | description = "Google OAuth access token"
96 | regex = '''ya29\.[0-9A-Za-z\-_]+'''
97 | tags = ["key", "Google", "OAuth"]
98 |
99 | [[rules]]
100 | description = "Heroku API key"
101 | regex = '''(?i)heroku(.{0,20})?['"][0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}['"]'''
102 | tags = ["key", "Heroku"]
103 |
104 | [[rules]]
105 | description = "MailChimp API key"
106 | regex = '''(?i)(mailchimp|mc)(.{0,20})?['"][0-9a-f]{32}-us[0-9]{1,2}['"]'''
107 | tags = ["key", "Mailchimp"]
108 |
109 | [[rules]]
110 | description = "Mailgun API key"
111 | regex = '''(?i)(mailgun|mg)(.{0,20})?['"][0-9a-z]{32}['"]'''
112 | tags = ["key", "Mailgun"]
113 |
114 | [[rules]]
115 | description = "PayPal Braintree access token"
116 | regex = '''access_token\$production\$[0-9a-z]{16}\$[0-9a-f]{32}'''
117 | tags = ["key", "Paypal"]
118 |
119 | [[rules]]
120 | description = "Picatic API key"
121 | regex = '''sk_live_[0-9a-z]{32}'''
122 | tags = ["key", "Picatic"]
123 |
124 | [[rules]]
125 | description = "Slack Webhook"
126 | regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}'''
127 | tags = ["key", "slack"]
128 |
129 | [[rules]]
130 | description = "Stripe API key"
131 | regex = '''(?i)stripe(.{0,20})?['\"'][sk|rk]_live_[0-9a-zA-Z]{24}'''
132 | tags = ["key", "Stripe"]
133 |
134 | [[rules]]
135 | description = "Square access token"
136 | regex = '''sq0atp-[0-9A-Za-z\-_]{22}'''
137 | tags = ["key", "square"]
138 |
139 | [[rules]]
140 | description = "Square OAuth secret"
141 | regex = '''sq0csp-[0-9A-Za-z\\-_]{43}'''
142 | tags = ["key", "square"]
143 |
144 | [[rules]]
145 | description = "Twilio API key"
146 | regex = '''(?i)twilio(.{0,20})?['\"][0-9a-f]{32}['\"]'''
147 | tags = ["key", "twilio"]
148 |
149 | [[rules]]
150 | description = "Password in URL"
151 | regex = '''[a-zA-Z]{3,10}:\/\/[^\/\s:@]{3,20}:[^\/\s:@]{3,20}@.{1,100}\/?.?'''
152 | tags = ["key", "URL", "generic"]
153 |
154 |
155 | [[rules]]
156 | description = "Env Var"
157 | regex = '''(?i)(apikey|secret|key|api|password|pass|pw|host)=[0-9a-zA-Z-_.{}]{4,120}'''
158 | tags = ["env"]
159 | [rules.allowlist]
160 | description = "ignore value fake"
161 | regexes = [
162 | '''host=HOST''',
163 | '''--private-key={{.PRIVATE_KEY_FILE}}''',
164 | '''PASSWORD=XXXXXX''',
165 | '''password={password}''',
166 | ]
167 |
168 | [[rules]]
169 | description = "High Entropy"
170 | regex = '''[0-9a-zA-Z-_!{}/=]{4,120}'''
171 | file = '''(?i)(dump.sql|high-entropy-misc.txt)$'''
172 | tags = ["entropy"]
173 | [[rules.Entropies]]
174 | Min = "4.3"
175 | Max = "7.0"
176 | [rules.allowlist]
177 | description = "ignore some"
178 | files = ['''(.*pub|env)$''']
179 | paths = ['''(security.*)''']
180 |
181 | [[rules]]
182 | description = "Potential bash var"
183 | regex='''(?i)(=)([0-9a-zA-Z-_!{}=]{4,120})'''
184 | tags = ["key", "bash", "API", "generic"]
185 | [[rules.Entropies]]
186 | Min = "3.5"
187 | Max = "4.5"
188 | Group = "1"
189 |
190 | [[rules]]
191 | description = "WP-Config"
192 | regex='''define(.{0,20})?(DB_CHARSET|NONCE_SALT|LOGGED_IN_SALT|AUTH_SALT|NONCE_KEY|DB_HOST|DB_PASSWORD|AUTH_KEY|SECURE_AUTH_KEY|LOGGED_IN_KEY|DB_NAME|DB_USER)(.{0,20})?['|"'].{10,120}['|"']'''
193 | tags = ["key", "API", "generic"]
194 |
195 | [[rules]]
196 | description = "Generic API Key"
197 | regex = '''[a|A][p|P][i|I][_]?[k|K][e|E][y|Y].*['|\"][0-9a-zA-Z]{32,45}['|\"]'''
198 |
199 | [[rules]]
200 | description = "Generic Secret"
201 | regex = '''[s|S][e|E][c|C][r|R][e|E][t|T].*['|\"][0-9a-zA-Z]{32,45}['|\"]'''
202 |
203 |
204 | [[rules]]
205 | description = "Files with keys and credentials"
206 | file = '''(?i)(id_rsa|passwd|id_rsa.pub|pgpass)$'''
207 | tags = ["key", "files"]
208 | [rules.allowlist]
209 | description = "ignore some"
210 | files = ['''(.*pub|env)$''']
211 |
212 | [[rules]]
213 | description = "Extension Files with keys and credentials"
214 | file = '''(.*?)(pub|pem|ppk|key)$'''
215 | tags = ["key", "files"]
216 | [rules.allowlist]
217 | description = "ignore file test"
218 | files = [
219 | '''.*-test.*$''',
220 | ]
221 |
222 | # Global allowlist
223 | [allowlist]
224 | description = "Whitelisted files"
225 | paths = [
226 | '''^vendor/''',
227 | '''^bower_components/''',
228 | '''^public/''',
229 | '''^node_modules/''',
230 | '''^theme/''',
231 | ]
232 | files = [
233 | '''(.*?)(jpg|gif|png|doc|pdf|bin|mp3|mp4|mov|ttf|woff|woff2|eot|lock)$''',
234 | '''^\.gitignore$''',
235 | '''^\.gitleaks.toml$''',
236 | '''^yarn.lock$''',
237 | '''^vendor/(.*?)$''',
238 | '''^sonar-project.properties$''',
239 | '''^test/fixtures/keys/.*-test.*$''',
240 | '''^node_modules/(.*?)$''',
241 | ]
242 |
243 | commits = []
244 |
245 | [whitelist]
246 | description = "image and html allowlists"
247 | paths = [
248 | '''^vendor/''',
249 | '''^bower_components/''',
250 | '''^public/''',
251 | '''^node_modules/''',
252 | '''^theme/''',
253 | ]
254 |
255 | files = [
256 | '''(.*?)(jpg|gif|png|doc|pdf|bin|mp3|mp4|mov|ttf|woff|woff2|eot|lock)$''',
257 | '''^\.gitignore$''',
258 | '''^\.gitleaks.toml$''',
259 | '''^\.gitignore$''',
260 | '''^yarn.lock$''',
261 | '''^sonar-project.properties$''',
262 | '''^test/fixtures/keys/.*-test.*$''',
263 | ]
264 |
265 | commits = []
266 |
--------------------------------------------------------------------------------
/.ci/linters/.pylintrc:
--------------------------------------------------------------------------------
1 | [MASTER]
2 |
3 | # Specify a configuration file.
4 | #rcfile=
5 |
6 | # Python code to execute, usually for sys.path manipulation such as
7 | # pygtk.require().
8 | #init-hook=
9 |
10 | # Profiled execution.
11 | # profile=no
12 |
13 | # Add files or directories to the blacklist. They should be base names, not
14 | # paths.
15 | ignore=migrations,settings.py,settings_openshift.py,settings_test.py,settings_test_mysql.py,settings_test_postgresql.py,settings_test_sqlite.py,.git,test-repos,repos,settings_test_nose.py
16 |
17 | # Pickle collected data for later comparisons.
18 | persistent=yes
19 |
20 | # List of plugins (as comma separated values of python modules names) to load,
21 | # usually to register additional checkers.
22 | load-plugins=
23 |
24 |
25 | [MESSAGES CONTROL]
26 |
27 | # Enable the message, report, category or checker with the given id(s). You can
28 | # either give multiple identifier separated by comma (,) or put this option
29 | # multiple time. See also the "--disable" option for examples.
30 | #enable=
31 |
32 | # Disable the message, report, category or checker with the given id(s). You
33 | # can either give multiple identifiers separated by comma (,) or put this
34 | # option multiple times (only on the command line, not in the configuration
35 | # file where it should appear only once).You can also use "--disable=all" to
36 | # disable everything first and then reenable specific checks. For example, if
37 | # you want to run only the similarities checker, you can use "--disable=all
38 | # --enable=similarities". If you want to run only the classes checker, but have
39 | # no Warning level messages displayed, use"--disable=all --enable=classes
40 | # --disable=W"
41 | # C0111 Missing docstring
42 | # I0011 Warning locally suppressed using disable-msg
43 | # W0142 Used * or * magic* Used when a function or method is called using *args or **kwargs to dispatch arguments.
44 | # W0613 Unused argument %r Used when a function or method argument is not used.
45 | # R0201 Method could be a function
46 | # E1101 does not work well on metaclasses like Django models or Mechanize browser
47 | # E1103 does not work with WSGIRequest or file objects
48 | # W0703 Catching too general exception Exception
49 | # R0921,R0922 Is raised when abstract classes are used in different module
50 | # E1002 Produces lot of false positives with Django 1.5
51 | # R0401(cyclic-import) we have too many of them
52 | # C0411(wrong-import-order) should be probably fixed
53 | # E1102: _ is not callable
54 | # C0103: Invalid name
55 | # C0301: Line too long
56 | # C0302: Too many lines in module
57 | # R0903: Too few public method
58 | # R0904: Too many public methods
59 | # R0912: Too many branches
60 | # R0913: Too many arguments
61 | # R0914: Too many local variables
62 | # R0915: Too many statements
63 | # R0201: Method could be a function
64 | # W0142: Used * or ** magic
65 | # W0231: __init__ method from base class is not called
66 | # W0232: Class has no __init__ method
67 | # W0212: Access to a protected member _meta of a client class
68 |
69 | disable=import-error,missing-super-argument,too-few-public-methods,
70 | no-member,no-init,old-style-class,C0111,I0011,W0142,W0613,
71 | E1103,E1101,E1102,R0401,R0921,R0922,E1002,C0411,W0703,R0201,
72 | C0301,W0231,W0232,W0212,C0330
73 |
74 |
75 | [REPORTS]
76 |
77 | # Set the output format. Available formats are text, parseable, colorized, msvs
78 | # (visual studio) and html. You can also give a reporter class, eg
79 | # mypackage.mymodule.MyReporterClass.
80 | output-format=text
81 |
82 | # Put messages in a separate file for each module / package specified on the
83 | # command line instead of printing them on stdout. Reports (if any) will be
84 | # written in a file name "pylint_global.[txt|html]".
85 | files-output=no
86 |
87 | # Tells whether to display a full report or only the messages
88 | reports=no
89 |
90 | # Python expression which should return a note less than 10 (10 is the highest
91 | # note). You have access to the variables errors warning, statement which
92 | # respectively contain the number of errors / warnings messages and the total
93 | # number of statements analyzed. This is used by the global evaluation report
94 | # (RP0004).
95 | evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
96 |
97 | # Add a comment according to your evaluation note. This is used by the global
98 | # evaluation report (RP0004).
99 | # comment=no
100 |
101 | # Template used to display messages. This is a python new-style format string
102 | # used to format the message information. See doc for all details
103 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
104 |
105 |
106 | [TYPECHECK]
107 |
108 | # Tells whether missing members accessed in mixin class should be ignored. A
109 | # mixin class is detected if its name ends with "mixin" (case insensitive).
110 | ignore-mixin-members=yes
111 |
112 | # List of module names for which member attributes should not be checked
113 | # (useful for modules/projects where namespaces are manipulated during runtime
114 | # and thus extisting member attributes cannot be deduced by static analysis
115 | ignored-modules=
116 |
117 | # List of classes names for which member attributes should not be checked
118 | # (useful for classes with attributes dynamically set).
119 | ignored-classes=SQLObject
120 |
121 | # When zope mode is activated, add a predefined set of Zope acquired attributes
122 | # to generated-members.
123 | # zope=no
124 |
125 | # List of members which are set dynamically and missed by pylint inference
126 | # system, and so shouldn't trigger E0201 when accessed. Python regular
127 | # expressions are accepted.
128 | generated-members=objects,DoesNotExist,id,pk,_meta,base_fields,context
129 |
130 |
131 | [VARIABLES]
132 |
133 | # Tells whether we should check for unused import in __init__ files.
134 | init-import=no
135 |
136 | # A regular expression matching the name of dummy variables (i.e. expectedly
137 | # not used).
138 | # dummy-variables-rgx=dummy,_
139 |
140 | # List of additional names supposed to be defined in builtins. Remember that
141 | # you should avoid to define new builtins when possible.
142 | additional-builtins=
143 |
144 |
145 | [FORMAT]
146 |
147 | # Maximum number of characters on a single line.
148 | max-line-length=80
149 |
150 | # Regexp for a line that is allowed to be longer than the limit.
151 | ignore-long-lines=^\s*(# )??$
152 |
153 | # Allow the body of an if to be on the same line as the test if there is no
154 | # else.
155 | single-line-if-stmt=no
156 |
157 | # List of optional constructs for which whitespace checking is disabled
158 | no-space-check=trailing-comma,dict-separator
159 |
160 | # Maximum number of lines in a module
161 | max-module-lines=1600
162 |
163 | # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
164 | # tab).
165 | indent-string=' '
166 |
167 | # Number of spaces of indent required inside a hanging or continued line.
168 | indent-after-paren=4
169 |
170 |
171 | [MISCELLANEOUS]
172 |
173 | # List of note tags to take in consideration, separated by a comma.
174 | notes=FIXME,XXX,TODO
175 |
176 |
177 | [SIMILARITIES]
178 |
179 | # Minimum lines number of a similarity.
180 | min-similarity-lines=4
181 |
182 | # Ignore comments when computing similarities.
183 | ignore-comments=yes
184 |
185 | # Ignore docstrings when computing similarities.
186 | ignore-docstrings=yes
187 |
188 | # Ignore imports when computing similarities.
189 | ignore-imports=no
190 |
191 |
192 | [BASIC]
193 |
194 | # Required attributes for module, separated by a comma
195 | # required-attributes=
196 |
197 | # List of builtins function names that should not be used, separated by a comma
198 | bad-functions=map,filter,apply,input,file
199 |
200 | # Good variable names which should always be accepted, separated by a comma
201 | good-names=_,i,j,k,e,qs,pk,setUp,tearDown,id
202 |
203 | # Bad variable names which should always be refused, separated by a comma
204 | bad-names=foo,bar,baz,toto,tutu,tata
205 |
206 | # Colon-delimited sets of names that determine each other's naming style when
207 | # the name regexes allow several styles.
208 | name-group=
209 |
210 | # Include a hint for the correct naming format with invalid-name
211 | include-naming-hint=no
212 |
213 | # Regular expression matching correct function names
214 | function-rgx=[a-zA_][a-zA-Z0-9_]{2,70}$
215 |
216 | # Naming hint for function names
217 | function-name-hint=[a-z_][a-z0-9_]{2,30}$
218 |
219 | # Regular expression matching correct variable names
220 | variable-rgx=[a-z_][a-z0-9_]{2,30}$
221 |
222 | # Naming hint for variable names
223 | variable-name-hint=[a-z_][a-z0-9_]{2,30}$
224 |
225 | # Regular expression matching correct constant names
226 | const-rgx=(([A-Z_][A-Z0-9_]*)|([a-z_][a-z0-9_]*)|(__.*__)|register|urlpatterns)$
227 |
228 | # Naming hint for constant names
229 | const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
230 |
231 | # Regular expression matching correct attribute names
232 | attr-rgx=[a-z_][a-z0-9_]{2,30}$
233 |
234 | # Naming hint for attribute names
235 | attr-name-hint=[a-z_][a-z0-9_]{2,30}$
236 |
237 | # Regular expression matching correct argument names
238 | argument-rgx=[a-z_][a-z0-9_]{2,30}$
239 |
240 | # Naming hint for argument names
241 | argument-name-hint=[a-z_][a-z0-9_]{2,30}$
242 |
243 | # Regular expression matching correct class attribute names
244 | class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
245 |
246 | # Naming hint for class attribute names
247 | class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
248 |
249 | # Regular expression matching correct inline iteration names
250 | inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
251 |
252 | # Naming hint for inline iteration names
253 | inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
254 |
255 | # Regular expression matching correct class names
256 | class-rgx=[A-Z_][a-zA-Z0-9_]+$
257 |
258 | # Naming hint for class names
259 | class-name-hint=[A-Z_][a-zA-Z0-9]+$
260 |
261 | # Regular expression matching correct module names
262 | module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
263 |
264 | # Naming hint for module names
265 | module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
266 |
267 | # Regular expression matching correct method names
268 | method-rgx=[a-z_][a-zA-Z0-9_]{2,70}$
269 |
270 | # Naming hint for method names
271 | method-name-hint=[a-z_][a-z0-9_]{2,30}$
272 |
273 | # Regular expression which should only match function or class names that do
274 | # not require a docstring.
275 | no-docstring-rgx=__.*__|_.*
276 |
277 | # Minimum line length for functions/classes that require docstrings, shorter
278 | # ones are exempt.
279 | docstring-min-length=-1
280 |
281 |
282 | [LOGGING]
283 |
284 | # Logging modules to check that the string format arguments are in logging
285 | # function parameter format
286 | logging-modules=logging
287 |
288 |
289 | [IMPORTS]
290 |
291 | # Deprecated modules which should not be used, separated by a comma
292 | deprecated-modules=regsub,TERMIOS,Bastion,rexec
293 |
294 | # Create a graph of every (i.e. internal and external) dependencies in the
295 | # given file (report RP0402 must not be disabled)
296 | import-graph=
297 |
298 | # Create a graph of external dependencies in the given file (report RP0402 must
299 | # not be disabled)
300 | ext-import-graph=
301 |
302 | # Create a graph of internal dependencies in the given file (report RP0402 must
303 | # not be disabled)
304 | int-import-graph=
305 |
306 |
307 | [DESIGN]
308 |
309 | # Maximum number of arguments for function / method
310 | max-args=10
311 |
312 | # Argument names that match this expression will be ignored. Default to name
313 | # with leading underscore
314 | ignored-argument-names=_.*
315 |
316 | # Maximum number of locals for function / method body
317 | max-locals=20
318 |
319 | # Maximum number of return / yield for function / method body
320 | max-returns=8
321 |
322 | # Maximum number of branch for function / method body
323 | max-branches=12
324 |
325 | # Maximum number of statements in function / method body
326 | max-statements=50
327 |
328 | # Maximum number of parents for a class (see R0901).
329 | max-parents=12
330 |
331 | # Maximum number of attributes for a class (see R0902).
332 | max-attributes=25
333 |
334 | # Minimum number of public methods for a class (see R0903).
335 | min-public-methods=0
336 |
337 | # Maximum number of public methods for a class (see R0904).
338 | max-public-methods=110
339 |
340 |
341 | [CLASSES]
342 |
343 | # List of interface methods to ignore, separated by a comma. This is used for
344 | # instance to not check methods defines in Zope's Interface base class.
345 | # ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
346 |
347 | # List of method names used to declare (i.e. assign) instance attributes.
348 | defining-attr-methods=__init__,__new__,setUp
349 |
350 | # List of valid names for the first argument in a class method.
351 | valid-classmethod-first-arg=cls
352 |
353 | # List of valid names for the first argument in a metaclass class method.
354 | valid-metaclass-classmethod-first-arg=mcs
355 |
356 |
357 | [EXCEPTIONS]
358 |
359 | # Exceptions that will emit a warning when being caught. Defaults to
360 | # "Exception"
361 | overgeneral-exceptions=Exception
362 |
363 | [Design]
364 | max-public-methods=100
365 | min-public-methods=0
366 | max-args=6
367 |
--------------------------------------------------------------------------------