-
Notifications
You must be signed in to change notification settings - Fork 49
Add GitHub labels #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8e02e57
Add github actions
paulacamargo25 553c1b0
Add checks
paulacamargo25 91fbb32
Add issue labels
paulacamargo25 dc993b5
Add github workflow checks
paulacamargo25 0ceb8a2
Add update_build_number to nox file
paulacamargo25 18795f5
Add vsce
paulacamargo25 f08fe1a
fix run test
paulacamargo25 25d47a3
Update vsce import
paulacamargo25 28ed834
Fix lint
paulacamargo25 050921c
Remove readme validation
paulacamargo25 1071dd0
fix lint
paulacamargo25 4402407
Remove only in tests
paulacamargo25 58fadf7
Add xvfb
paulacamargo25 5310085
Fix linting
paulacamargo25 b6e270c
Set DISPLAY in github actions
paulacamargo25 0dce97e
Use pipx
paulacamargo25 e6b3139
Fix lint
paulacamargo25 c182472
Fix pr comments
paulacamargo25 9594268
Update package-lock
paulacamargo25 78e4a75
Update package-lock
paulacamargo25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[flake8] | ||
ignore = W,BLK, | ||
E24,E121,E123,E125,E126,E221,E226,E266,E704, | ||
E265,E722,E501,E731,E306,E401,E302,E222,E303, | ||
E402,E305,E261,E262,E203 | ||
exclude = | ||
__pycache__, | ||
.eggs, | ||
.git, | ||
.tox, | ||
.nox, | ||
build, | ||
dist, | ||
src/test/python_tests/test_data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: 'Build VSIX' | ||
description: "Build the extension's VSIX" | ||
|
||
inputs: | ||
node_version: | ||
description: 'Version of Node to install' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.node_version }} | ||
cache: 'npm' | ||
|
||
# Minimum supported version is Python 3.7 | ||
- name: Use Python 3.7 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Pip cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-build-vsix-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-build-vsix- | ||
|
||
# For faster/better builds of sdists. | ||
- name: Update pip, install pipx and install wheel | ||
run: python -m pip install -U pip pipx wheel | ||
shell: bash | ||
|
||
- name: Run npm ci | ||
run: npm ci --prefer-offline | ||
shell: bash | ||
|
||
- name: Install bundled python libraries | ||
run: pipx run nox --session install_bundled_libs | ||
shell: bash | ||
|
||
# Use the GITHUB_RUN_ID environment variable to update the build number. | ||
# GITHUB_RUN_ID is a unique number for each run within a repository. | ||
# This number does not change if you re-run the workflow run. | ||
- name: Update extension build number | ||
run: pipx run nox --session update_build_number -- $GITHUB_RUN_ID | ||
shell: bash | ||
|
||
- name: Build VSIX | ||
run: npm run vsce-package | ||
shell: bash | ||
|
||
- name: Upload VSIX | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: linter-package | ||
path: | | ||
**/*.vsix | ||
if-no-files-found: error | ||
retention-days: 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: 'Lint' | ||
description: 'Lint TypeScript and Python code' | ||
|
||
inputs: | ||
node_version: | ||
description: 'Version of Node to install' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.node_version }} | ||
cache: 'npm' | ||
|
||
- name: Install Node dependencies | ||
run: npm ci | ||
shell: bash | ||
|
||
- name: Lint TypeScript code | ||
run: npm run lint | ||
shell: bash | ||
|
||
- name: Check TypeScript format | ||
run: npm run format-check | ||
shell: bash | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.7' | ||
|
||
- name: Pip cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-lint-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-lint- | ||
|
||
# For faster/better builds of sdists. | ||
- name: Update pip, install pipx and install wheel | ||
run: python -m pip install -U pip pipx wheel | ||
shell: bash | ||
|
||
# This will install libraries to a target directory. | ||
- name: Install bundled python libraries | ||
run: pipx run nox --session install_bundled_libs | ||
shell: bash | ||
|
||
- name: Check linting and formatting | ||
run: pipx run nox --session lint | ||
shell: bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'github-actions' | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
labels: | ||
- 'no-changelog' | ||
|
||
- package-ecosystem: 'github-actions' | ||
directory: .github/actions/lint | ||
schedule: | ||
interval: monthly | ||
labels: | ||
- 'no-changelog' | ||
|
||
- package-ecosystem: 'github-actions' | ||
directory: .github/actions/build-vsix | ||
schedule: | ||
interval: monthly | ||
labels: | ||
- 'no-changelog' | ||
|
||
- package-ecosystem: 'pip' | ||
directory: / | ||
schedule: | ||
interval: daily | ||
labels: | ||
- 'debt' | ||
commit-message: | ||
include: 'scope' | ||
prefix: 'pip' | ||
|
||
- package-ecosystem: 'npm' | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
labels: | ||
- 'no-changelog' | ||
ignore: | ||
- dependency-name: '@types/vscode' | ||
- dependency-name: '@types/node' | ||
- dependency-name: 'vscode-languageclient' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
changelog: | ||
exclude: | ||
labels: | ||
- 'no-changelog' | ||
|
||
categories: | ||
- title: Enhancements | ||
labels: | ||
- 'feature-request' | ||
|
||
- title: Bug Fixes | ||
labels: | ||
- 'bug' | ||
|
||
- title: Code Health | ||
labels: | ||
- 'debt' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: 'CodeQL' | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [main] | ||
schedule: | ||
- cron: '15 16 * * 2' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: ['javascript', 'python'] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] | ||
# Learn more about CodeQL language support at https://git.io/codeql-language-support | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Issue labels | ||
|
||
on: | ||
issues: | ||
types: [opened, reopened] | ||
|
||
permissions: | ||
issues: write | ||
|
||
jobs: | ||
# From https://github.com/marketplace/actions/github-script#apply-a-label-to-an-issue. | ||
add-triage-label: | ||
name: "Add 'triage-needed'" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const result = await github.rest.issues.listLabelsOnIssue({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number, | ||
}) | ||
const labels = result.data.map((label) => label.name) | ||
const hasNeeds = labels.some((label) => label.startsWith('needs')) | ||
|
||
if (!hasNeeds) { | ||
console.log('This issue is not labeled with a "needs __" label, add the "triage-needed" label.') | ||
|
||
github.rest.issues.addLabels({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number, | ||
labels: ['triage-needed'] | ||
}) | ||
} else { | ||
console.log('This issue already has a "needs __" label, do not add the "triage-needed" label.') | ||
} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be using microsoft/vscode-github-triage-actions