Skip to content

Commit

Permalink
ci: lint pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
dvirtz committed Jul 8, 2024
1 parent b6da4a7 commit 202b4dc
Show file tree
Hide file tree
Showing 9 changed files with 1,587 additions and 104 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
pull_request:
push:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn
- name: Install dependencies
run: yarn
- name: Lint
run: yarn lint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 dvirtz
Copyright (c) 2024 Dvir Yitzchaki dvirtz@gmail.omc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# MusicBrainz Scripts

[![CI](https://github.com/dvirtz/musicbrainz-scripts/actions/workflows/ci.yml/badge.svg)](https://github.com/dvirtz/musicbrainz-scripts/actions/workflows/ci.yml)

This repository contains a collection of user scripts for [MusicBrainz](https://musicbrainz.org).

## Installation
Expand Down
23 changes: 23 additions & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
version: "0.2"
words:
- Dvir
- dvirtz
- mbid
- musicbrainz
- rels
- setlist
- userscripts
- Yitzchaki
patterns:
- name: user_script_id
pattern: >-
/\/\/ @id.*/g
overrides:
- filename: scripts/*.user.js
ignoreRegExpList:
- user_script_id
- filename: package.json
includeRegExpList:
- >-
/"description":.*/g
19 changes: 19 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import greaseMonkey from 'eslint-config-greasemonkey';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';

export default [
{
files: ['**/*.user.js'],
languageOptions: {
sourceType: 'script',
globals: greaseMonkey.globals,
},
},
{
languageOptions: {globals: globals.browser},
},
eslintPluginPrettierRecommended,
pluginJs.configs.recommended,
];
44 changes: 44 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "musicbrainz-scripts",
"description": "Collection of userscripts for MusicBrainz",
"main": "index.js",
"scripts": {
"prettier:format": "prettier mb*user.js",
"lint": "yarn eslint && yarn cspell ."
},
"repository": {
"type": "git",
"url": "git+https://github.com/dvirtz/musicbrainz-scripts.git"
},
"keywords": [
"musicbrainz",
"userscripts"
],
"author": "Dvir Yitzchaki <dvirtz@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/dvirtz/musicbrainz-scripts/issues"
},
"homepage": "https://github.com/dvirtz/musicbrainz-scripts",
"devDependencies": {
"@eslint/js": "^9.6.0",
"cspell": "^8.10.4",
"eslint": "9.x",
"eslint-config-greasemonkey": "^1.0.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.3.2"
},
"prettier": {
"printWidth": 120,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"quoteProps": "preserve",
"trailingComma": "es5",
"bracketSpacing": false,
"arrowParens": "avoid"
},
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
}
Loading

0 comments on commit 202b4dc

Please sign in to comment.