Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Major cleanup #251

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
setup/lib/* linguist-generated=true
setup/dist/* linguist-generated=true
hlint-setup/dist/* linguist-generated=true
hlint-run/dist/* linguist-generated=true
49 changes: 49 additions & 0 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Check dist

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
check-dist:
strategy:
matrix:
action: ['setup', 'hlint-setup', 'hlint-run']
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ matrix.action }}

steps:
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: npm install

- name: Rebuild the dist/ directory
run: npm run build

- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/* | wc -l)" -gt "0" ]; then
echo "::error::Detected uncommitted changes after build. Please run \`npm run build\` locally and commit the changes. See status below:"
git diff
exit 1
fi
id: diff

# If index.js or post.js are different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
21 changes: 10 additions & 11 deletions .github/workflows/hlint-run.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: "/hlint-run"
name: /hlint-run
on:
pull_request:
branches:
- main
push:
branches:
- master
- 'releases/*'
- main

defaults:
run:
working-directory: "hlint-run"
working-directory: 'hlint-run'

jobs:
unit-tests:
Expand All @@ -17,13 +18,11 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
cache: "yarn"
cache-dependency-path: hlint-run/yarn.lock
- run: yarn
- run: yarn compile
- run: yarn package
- run: yarn test
node-version: '16'
cache: 'npm'
cache-dependency-path: hlint-run/package-lock.json
- run: npm install
- run: npm run all

test:
runs-on: ubuntu-latest
Expand Down
27 changes: 7 additions & 20 deletions .github/workflows/hlint-setup.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,27 @@
name: "/hlint-setup"
name: /hlint-setup
on:
pull_request:
branches:
- main
push:
branches:
- master
- 'releases/*'
- main

defaults:
run:
working-directory: "hlint-setup"
working-directory: 'hlint-setup'

jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
cache: "yarn"
cache-dependency-path: hlint-setup/yarn.lock
- run: yarn
- run: yarn test
- run: npm install
- run: npm run all

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
cache: "yarn"
cache-dependency-path: hlint-setup/yarn.lock
- run: yarn
working-directory: "hlint-setup"
- run: yarn compile
- run: yarn package
- uses: ./hlint-setup
- run: hlint --version
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "/release"
name: Release
on:
push:
tags:
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/workflow.yml → .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
name: "/setup"
name: /setup
on:
pull_request:
branches:
- main
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:

defaults:
run:
Expand All @@ -21,17 +18,16 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"
cache-dependency-path: setup/package-lock.json
- run: npm ci --prefer-offline --no-audit --progress=false
- run: npm run bundle
- run: npm test
- run: npm install
- run: npm run all

install-haskell:
name: GHC ${{ matrix.plan.ghc }}, Cabal ${{ matrix.plan.cabal }} - ${{ matrix.os }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# IntelliJ
.idea/
*.iml

*/dist/index.js.map
File renamed without changes.
3 changes: 2 additions & 1 deletion setup/.prettierignore → hlint-run/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist/
lib/
.out/
__tests__/
node_modules/
*.json
39 changes: 39 additions & 0 deletions hlint-run/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
ignorePatterns: ['dist/**/*', 'build/**/*'],
extends: [
'standard',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: '2020'
},
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'import/order': 'error',
'no-use-before-define': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', {argsIgnorePattern: '^_'}],
'n/no-callback-literal': 'off',
'@typescript-eslint/consistent-type-imports': [
'error',
{prefer: 'type-imports'}
],
'@typescript-eslint/no-use-before-define': 'error',
'prettier/prettier': [
'error',
{
tabWidth: 2,
printWidth: 80,
useTabs: false,
semi: true,
singleQuote: true,
trailingComma: 'none',
bracketSpacing: false,
allowParens: 'avoid',
endOfLine: 'auto'
}
]
}
};
59 changes: 0 additions & 59 deletions hlint-run/dist/github/core.js

This file was deleted.

18 changes: 0 additions & 18 deletions hlint-run/dist/github/index.js

This file was deleted.

65 changes: 0 additions & 65 deletions hlint-run/dist/github/parse.js

This file was deleted.

Loading