Skip to content

Commit

Permalink
Merge pull request #1 from z-shell/main-1.0.1
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
ss-o authored Jan 30, 2023
2 parents 82f1430 + 118c9ec commit 7870a70
Show file tree
Hide file tree
Showing 28 changed files with 638 additions and 103 deletions.
60 changes: 60 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Space or Tabs?
# https://stackoverflow.com/questions/35649847/objective-reasons-for-using-spaces-instead-of-tabs-for-indentation
# https://stackoverflow.com/questions/12093748/how-to-use-tabs-instead-of-spaces-in-a-shell-script
# https://github.com/editorconfig/editorconfig-defaults/blob/master/editorconfig-defaults.json
#
# 1. What happens when I press the Tab key in my text editor?
# 2. What happens when I request my editor to indent one or more lines?
# 3. What happens when I view a file containing U+0009 HORIZONTAL TAB characters?
#
# Answers:
#
# 1. Pressing the Tab key should indent the current line (or selected lines) one additional level.
# 2. As a secondary alternative, I can also tolerate an editor that,
# like Emacs, uses this key for a context-sensitive fix-my-indentation command.
# 3. Indenting one or more lines should follow the reigning convention, if consensus is sufficiently strong; otherwise,
# I greatly prefer 2-space indentation at each level. U+0009 characters should shift subsequent characters to the next tab stop.
#
# Note: VIM users should use alternate marks [[[ and ]]] as the original ones can confuse nested substitutions, e.g.: ${${${VAR}}}
#
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.sln]
indent_style = tab

[*.{md,mdx,rst}]
trim_trailing_whitespace = false

[*.{cmd,bat}]
end_of_line = crlf

[*za-*]
end_of_line = lf

[*.{sh,bash,zsh,fish}]
end_of_line = lf

[Makefile]
indent_style = tab
indent_size = 4

[*.{py,rb}]
indent_size = 4

[*.{go,java,scala,groovy,kotlin}]
indent_style = tab
indent_size = 4

[*.{cs,csx,cake,vb,vbx}]
# Default Severity for all .NET Code Style rules below
dotnet_analyzer_diagnostic.severity = warning
83 changes: 83 additions & 0 deletions .github/ISSUE_TEMPLATE/01_bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: "🐞 Bug report"
description: File a bug report
title: "[bug]: "
labels: ["bug 🐞", "triage 📑"]
body:
- type: markdown
attributes:
value: |
First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.
- type: input
id: environment
attributes:
label: Environment
description: >
Please describe your environment e.g: echo "OSTYPE=${OSTYPE} CPUTYPE=$(uname -m) / MACHINE_TYPE=$MACHTYPE ZSH_VERSION=${ZSH_VERSION}"
It may contain any additional information which would help to reproduce the issue.
placeholder: "OSTYPE=linux-gnu CPUTYPE=x86_64 / MACHINE_TYPE=x86_64 ZSH_VERSION=5.8"
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
description: "Please describe the expected behavior"
validations:
required: true
- type: textarea
id: current
attributes:
label: Current behavior
description: "Please describe how the bug manifests"
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce
description: "Explain the steps required to duplicate the issue"
validations:
required: true
- type: textarea
id: code-snippet
attributes:
label: Code snippet
description: "Please insert your zshrc or just a short code snippet in concern"
validations:
required: true
- type: textarea
id: additional
attributes:
label: Aditional information
description: "List any other information that is relevant to your issue. For reports and stats run `zi analytics`"
validations:
required: true
- type: checkboxes
attributes:
label: Self-service
description: |
If you feel like you could contribute to this issue, please check the box below. This would tell us and other people looking for contributions that someone's working on it.
If you do check this box, please send a pull request within 7 days so we can still delegate this to someone else.
options:
- label: I'd be willing to address this documentation request myself.
- type: checkboxes
attributes:
label: Have you read the Contributing Guidelines?
options:
- label: I have read the [Contributing Guidelines](https://github.com/z-shell/community/blob/main/docs/CONTRIBUTING_GUIDELINES.md).
required: true
- type: checkboxes
attributes:
label: Are you familiar with Contributor Covenant Code of Conduct?
options:
- label: I have read the [Contributor Covenant Code of Conduct](https://github.com/z-shell/zi/blob/main/docs/CODE_OF_CONDUCT.md).
required: true
- type: input
id: contact
attributes:
label: Contact Details
description: How can we get in touch with you if we need more info?
placeholder: ex. email@example.com
validations:
required: false
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
blank_issues_enabled: true
contact_links:
- name: Wiki
url: https://wiki.zshell.dev
about: Knowledge base
- name: Discussions
url: https://discussions.zshell.dev
about: Please ask and answer questions here
- name: Matrix
url: https://matrix.zshell.dev
about: An open network for secure, decentralized communication
- name: Slack
url: https://join.slack.com/t/z-shell/shared_invite/zt-16twpopd2-p08ROUeT2aGZ5njJwysawA
about: Workspace to collaborate, ask and answer questions
- name: Crowdin
url: https://translate.zshell.dev
about: Translation and localization management
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
49 changes: 49 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
documentation 📝:
- "docs/**/*.md"
- "community/**/*.md"
- "ecosystem/**/*.md"
dependencies 📦:
- "package.json"
- "pnpm-lock.yaml"
- "yarn.lock"
enhancement ✨:
- "functions/**"
- "src/**"
- "lib/**"
maintenance 📈:
- ".all-contributorsrc"
- ".deepsource.toml"
- ".editorconfig"
- ".gitattributes"
- ".gitignore"
- ".github/CODEOWNERS"
- ".github/*.md"
- ".github/*.yml"
- ".github/*.yaml"
- ".github/*.json"
- ".markdownlint.json"
- ".prettierrc"
- ".prettierignore"
- ".trunk/*.yaml"
- ".trunk/*.json"
- ".trunk/*rc"
- ".vscode/**"
- "babel.config.js"
- "docusaurus.config.js"
- "crowdin.yml"
- "netlify.toml"
- "tsconfig.json"
i18n 🌐:
- "i18n/**"
- "docs/i18n/**"
#annex 🌀:
# - "*"
#package 📦:
# - 'ecosystem/packages/**/*.md'
# - 'i18n/**/docusaurus-plugin-content-ecosystem/**/packages/**/*.md'
plugin ⚙️:
- "*"
# - 'ecosystem/plugins/**.md'
# - 'i18n/**/docusaurus-plugin-content-ecosystem/**/plugins/**/*.md'
ci 🤖:
- ".github/workflows/*"
31 changes: 31 additions & 0 deletions .github/workflows/comment-rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# @format
---
name: "🔁 Rebase"

on:
issue_comment:
types: [created]

jobs:
rebase:
runs-on: ubuntu-latest
name: 🔁 Rebase
# Automate with comments: /autosquash, /rebase
if: >-
github.event.issue.pull_request != '' && (
contains(github.event.comment.body, '/rebase') ||
contains(github.event.comment.body, '/autosquash')
)
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: 🔁 Rebase
uses: z-shell/.github/actions/rebase@v1.0.5
with:
autosquash: ${{ contains(github.event.comment.body, '/autosquash') || contains(github.event.comment.body, '/rebase-autosquash') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: 🔖 Pull Request Labeler
on:
pull_request_target:

permissions:
contents: read
pull-requests: write

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GH_PAT }}"
sync-labels: false
30 changes: 30 additions & 0 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# @format
---
name: 🔒 Lock closed issues and PRs

on:
schedule:
- cron: "30 2 * * *"

jobs:
lock:
name: 🔐 Lock closed issues and PRs
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
concurrency:
group: ci-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
steps:
- uses: dessant/lock-threads@v4
with:
github-token: ${{ github.token }}
issue-inactive-days: "30"
issue-lock-reason: ""
issue-comment: >
Issue closed and locked due to lack of activity. If you encounter this same issue, please open a new issue and refer to this closed one.
pr-inactive-days: "7"
pr-lock-reason: ""
pr-comment: >
Pull Request closed and locked due to lack of activity. If you'd like to build on this closed PR, you can clone it using this method: https://stackoverflow.com/a/14969986 Then open a new PR, referencing this closed PR in your message.
29 changes: 29 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: 👻 Stale

on:
schedule:
- cron: "0 8 * * *"
workflow_dispatch:

jobs:
stale:
name: 🧹 Clean up stale issues and PRs
runs-on: ubuntu-latest
steps:
- name: 🚀 Run stale
uses: actions/stale@v7.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
days-before-close: 7
remove-stale-when-updated: true
stale-issue-label: "stale 👻"
exempt-issue-labels: "no-stale 🔒,help-wanted 👥"
stale-issue-message: >
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!
stale-pr-label: "stale 👻"
exempt-pr-labels: "no-stale 🔒"
stale-pr-message: >
There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale. This PR will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!
12 changes: 12 additions & 0 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: "♻️ Sync Labels"

on:
schedule:
- cron: "22 2 * * 2"
workflow_dispatch:

jobs:
labels:
name: "♻️ Sync labels"
uses: z-shell/.github/.github/workflows/sync-labels.yml@main
43 changes: 43 additions & 0 deletions .github/workflows/test-sh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: 🐧 Test sh (Linux)
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- name: ☑️ ShellCheck
uses: ludeeus/action-shellcheck@6d3f514f44620b9d4488e380339edc0d9bbe2fba
with:
scandir: "./doc/install.sh"

build:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [shellcheck]
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- name: ⚙️ Prepare
run: |
sudo apt-get update
sudo apt-get install -y zsh
- name: ⚙️ Test
run: sh ./doc/install.sh
- name: ⚙️ Load
run: |
source ~/.zshrc
cat ~/.zshrc
echo "zsh version: $ZSH_VERSION"
shell: zsh {0}
Loading

0 comments on commit 7870a70

Please sign in to comment.