Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Refactor: change to classes #14

Merged
merged 29 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
36ab995
remove: labels individual files
Nov 5, 2020
aac8ade
feat: new api files
Nov 5, 2020
32e4bf0
refactor: index.ts import
Nov 5, 2020
71cd4f0
style: updating code style
Nov 5, 2020
f99f12f
fix: Variable 'files' should be referenced after its declaration at l…
Nov 5, 2020
d6a83b1
style: switch to "prettier" instead of "prettier-standard"
Nov 5, 2020
8d77a25
fix: restyler.yaml
Nov 5, 2020
788d832
style: quotations
Nov 5, 2020
f490072
remove: restyled
Nov 5, 2020
cdf2d89
fix: require SuperLabeler
Nov 5, 2020
50e100a
fix: src/superLabeler
Nov 5, 2020
2afaee9
refactor: convert to classes
Nov 7, 2020
5f77466
fix: Imported binding not used
Nov 7, 2020
01bf09f
fix: superLabeler is not a constructor
Nov 7, 2020
d1c88ee
build: 01bf09f6ef1f81ea3cd8c4d36fd07c65d701071f
Nov 7, 2020
89391e3
maint: change token to BOT_TOKEN
Nov 7, 2020
d17d66c
fix: not running properly
Nov 10, 2020
7dbc317
fix: AWAIT_NON_PROMISE
Nov 10, 2020
b69d9d0
fix: UNUSED_IMPORT
Nov 10, 2020
f8b461c
fix: duplicate console output
Nov 10, 2020
0b2c3c5
fix: filtering error
Nov 10, 2020
6f1ecae
build: 0b2c3c5c15f78f5785e8ef39b8340faca8ed12e8
Nov 10, 2020
5eb04cb
fix: won't apply label cause it thinks it has it
Nov 10, 2020
a5b94be
fix: filter null descriptions
Nov 10, 2020
c739376
build: a5b94be578d9f05dca05271fdd0c349253c5cd41
Nov 10, 2020
9bf6b7b
fix: requires 1 not 2
Nov 10, 2020
365e003
feat: show matches / required
Nov 10, 2020
1f8e13d
Revert "fix: won't apply label cause it thinks it has it"
Nov 10, 2020
d03d442
build: 1f8e13dbd74dff4746fc83a923c0239de7250a5e
Nov 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ about: Report a bug with Super Labeler
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -32,6 +32,7 @@ Add your `labels.json` config and Github Actions workflow:
```yaml
insert workflow here
```

**Github Actions Output**
Please [set the `ACTIONS_RUNNER_DEBUG` secret to `true` to enable debug logging](https://help.github.com/en/actions/configuring-and-managing-workflows/managing-a-workflow-run#enabling-debug-logging), rerun the labeler workflow, and paste the output below:

Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Suggest an idea for this project
title: ''
labels: enhancement, proposal
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
Expand All @@ -17,7 +16,7 @@ If you're proposing a new condition, please include an example of the JSON confi

```json
{
name: "example",
"name": "example",
"foo": "bar"
}
```
Expand Down
28 changes: 14 additions & 14 deletions .github/labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@
]
},
"optimisation": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "titleMatches",
Expand All @@ -490,7 +490,7 @@
]
},
"style": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "titleMatches",
Expand All @@ -511,7 +511,7 @@
]
},
"refactor": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "titleMatches",
Expand All @@ -536,7 +536,7 @@
]
},
"revert": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "titleMatches",
Expand All @@ -557,7 +557,7 @@
]
},
"deprecated": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "titleMatches",
Expand All @@ -582,7 +582,7 @@
]
},
"removal": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "titleMatches",
Expand Down Expand Up @@ -655,7 +655,7 @@
]
},
"closed": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "isLocked",
Expand Down Expand Up @@ -926,7 +926,7 @@
]
},
"optimisation": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "titleMatches",
Expand All @@ -947,7 +947,7 @@
]
},
"style": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "titleMatches",
Expand All @@ -964,7 +964,7 @@
]
},
"refactor": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "titleMatches",
Expand All @@ -985,7 +985,7 @@
]
},
"revert": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "titleMatches",
Expand All @@ -1002,7 +1002,7 @@
]
},
"deprecated": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "titleMatches",
Expand All @@ -1023,7 +1023,7 @@
]
},
"removal": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "titleMatches",
Expand Down Expand Up @@ -1083,7 +1083,7 @@
]
},
"closed": {
"requires": 2,
"requires": 1,
"conditions": [
{
"type": "isLocked",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
id: labeller
uses: ./
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://npm.pkg.github.com/videndum
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

13 changes: 13 additions & 0 deletions .prettier.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"jsxSingleQuote": false,
"printWidth": 80,
"quoteProps": "as-needed",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
}
26 changes: 13 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand Down
4 changes: 4 additions & 0 deletions __tests__/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
export INPUT_GITHUB_TOKEN=your-personal-token
export GITHUB_REPOSITORY=owner/repo-name

# Choose one
GITHUB_EVENT_PATH=__tests__/event.pr.json
# GITHUB_EVENT_PATH=__tests__/event.issue.json

# Optional
export INPUT_CONFIG=labels.local.json

Expand Down
35 changes: 20 additions & 15 deletions __tests__/Utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,48 +1,53 @@
import * as utils from '../src/utils'
import { utils } from '../src/utils'
const settings = {
labels: {
test: {
name: 'test',
color: 'CFD3D7',
description: 'This issue / pull request has been abandon',
},
description: 'This issue / pull request has been abandon'
}
},
issue: {
bug: {
requires: 1,
conditions: [
{
type: 'titleMatches',
pattern: '/^bug(\\(.*\\))?:/i',
pattern: '/^bug(\\(.*\\))?:/i'
},
{
type: 'descriptionMatches',
pattern: '/(created|new|opened|made)( an| a)? bug/i',
},
],
},
pattern: '/(created|new|opened|made)( an| a)? bug/i'
}
]
}
},
pr: {
bug: {
requires: 1,
conditions: [
{
type: 'titleMatches',
pattern: '/^bug(\\(.*\\))?:/i',
pattern: '/^bug(\\(.*\\))?:/i'
},
{
type: 'descriptionMatches',
pattern: '/(created|new|opened|made)( an| a)? bug/i',
},
],
},
},
pattern: '/(created|new|opened|made)( an| a)? bug/i'
}
]
}
}
}
test('test colour format', async () => {
await expect(utils.formatColor(settings.labels.test.color)).toBe('CFD3D7')
})
test('test colour format', async () => {
await expect(utils.formatColor(`#${settings.labels.test.color}`)).toBe(
'CFD3D7',
'CFD3D7'
)
})
// test('Run entire script', async () => {
// await expect(utils.formatColor(`#${settings.labels.test.color}`)).toBe(
// 'CFD3D7'
// )
// })
15 changes: 0 additions & 15 deletions __tests__/event.pr.example.json

This file was deleted.

2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Everything Labeler'
description: 'A superpowered issue and pull request labeler for Github Actions.'
author: ['IvanFon', 'videndum', 'jbinda', 'jayu']
author: 'Videndum'
inputs:
GITHUB_TOKEN:
description: 'The GITHUB_TOKEN secret'
Expand Down
Loading