Skip to content

Instantly share code, notes, and snippets.

View ybiquitous's full-sized avatar
🏯
Keep climbing

Masafumi Koba ybiquitous

🏯
Keep climbing
View GitHub Profile
@ybiquitous
ybiquitous / closure-vs-class.js
Created December 22, 2020 02:57
Closure vs Class on JavaScript
// closure
function foo(initial = 0) {
let counter = initial
return {
get counter() { return counter },
increment() { counter += 1 },
}
}
const f1 = foo()
f1.counter //=> 0
@ybiquitous
ybiquitous / goodcheck.yml
Created October 2, 2020 09:26
Check `set-env` and `add-path` commands of GitHub Actions via Goodcheck
rules:
- id: github.actions.disallow-set-env-and-add-path
pattern:
- "set-env"
- "add-path"
glob:
- ".github/workflows/*.yml"
message: |
Disallow `set-env` and `add-path` commands in workflows of GitHub Actions.
@ybiquitous
ybiquitous / bar.yml
Last active July 3, 2020 12:12
Tips for the management for many Querly rules
- id: sample.sub.bar
pattern: bar
message: Disallo `bar` method
@ybiquitous
ybiquitous / .ruby-version
Last active June 25, 2020 01:11
Steep failure for Enumerable#filter_map
2.7.1
@ybiquitous
ybiquitous / stylelint-compact.json
Last active November 7, 2022 17:43
stylelint on GitHub Actions
{
"problemMatcher": [
{
"owner": "stylelint-compact",
"pattern": [
{
"regexp": "^(.+): line (\\d+), col (\\d+), (\\S+) - (.+) (\\(\\S+\\))$",
"file": 1,
"line": 2,
"column": 3,
@ybiquitous
ybiquitous / rubocop.yml
Last active November 2, 2020 02:53
RuboCop on GitHub Actions
# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
#
# https://docs.rubocop.org/rubocop/configuration.html#severity
name: RuboCop
on: pull_request
jobs:
@ybiquitous
ybiquitous / steep.yml
Last active August 6, 2021 21:27
Steep on GitHub Actions
# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
name: Steep
on: pull_request
jobs:
check:
runs-on: ubuntu-latest
@ybiquitous
ybiquitous / secretlint.yml
Last active May 13, 2021 08:46
Secretlint out of the box via GitHub Actions
# https://github.com/secretlint/secretlint
name: secretlint
on:
push:
branches: ['main']
pull_request:
branches: ['**']
jobs:
@ybiquitous
ybiquitous / skip-ci-on-actions.yml
Last active February 9, 2021 10:11
How to "[skip ci]" on GitHub Actions
# See also:
# - https://github.com/actions/runner/issues/774
# - https://help.github.com/en/actions/reference/events-that-trigger-workflows#push-event-push
# - https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
# - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
name: "[skip ci]" on Actions
on: [push, pull_request]
@ybiquitous
ybiquitous / release.yml
Last active April 14, 2020 14:30
How to automate GitHub releases via GitHub Actions
name: Release
on:
push:
tags: ["**"]
jobs:
run:
runs-on: ubuntu-latest
steps: