Skip to content

Commit 9bb2d6e

Browse files
committed
Merge branch 'release/2.1.0-alpha.0'
2 parents 481efb7 + 641acc1 commit 9bb2d6e

28 files changed

+1447
-653
lines changed

.github/renovate.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"github>studiometa/renovate"
5+
]
6+
}

.github/workflows/npm-publish.yml

+19-28
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,28 @@ jobs:
1717
registry-url: https://registry.npmjs.org/
1818

1919
- run: |
20-
VERSION=${GITHUB_REF/refs\/tags\//}
21-
TAG='latest'
22-
if [[ $VERSION =~ 'alpha' || $VERSION =~ 'beta' || $VERSION =~ 'rc' ]]; then
23-
TAG='next'
24-
fi
25-
npm publish --tag $TAG
26-
env:
27-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
20+
NPM_TAG='latest'
21+
IS_PRERELEASE=false
2822
29-
# @see https://github.com/actions/create-release/issues/38#issuecomment-715327220
30-
# @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files
31-
- name: Prepare the changelog from the tag message
32-
id: prepare_changelog
33-
run: |
34-
PRERELEASE=false
35-
# Check release type
3623
if [[ $GITHUB_REF_NAME =~ 'alpha' || $GITHUB_REF_NAME =~ 'beta' || $GITHUB_REF_NAME =~ 'rc' ]]; then
37-
echo "This is a prerelease."
38-
PRERELEASE=true
24+
NPM_TAG='next'
25+
IS_PRERELEASE=true
3926
fi
40-
echo "is_prerelease=$PRERELEASE" >> $GITHUB_ENV
4127
42-
# @see https://github.com/actions/create-release
43-
- name: Create Release
44-
id: create_release
45-
uses: actions/create-release@v1
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
echo "NPM_TAG=$NPM_TAG" >> $GITHUB_ENV
29+
echo "IS_PRERELEASE=$IS_PRERELEASE" >> $GITHUB_ENV
30+
31+
- uses: JS-DevTools/npm-publish@v3
32+
with:
33+
provenance: true
34+
package: .
35+
tag: ${{ env.NPM_TAG }}
36+
token: ${{ secrets.NPM_TOKEN }}
37+
38+
- uses: ncipollo/release-action@v1
4839
with:
49-
tag_name: ${{ github.ref }}
50-
release_name: v${{ github.ref_name }}
51-
body: Please refer to [CHANGELOG.md](https://github.com/studiometa/prettier-formatter-gitlab/blob/${{ github.ref_name }}/CHANGELOG.md) for details.
40+
tag: ${{ github.ref }}
41+
name: v${{ github.ref_name }}
42+
body: Please refer to [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/CHANGELOG.md) for details.
5243
draft: false
53-
prerelease: ${{ env.is_prerelease }}
44+
prerelease: ${{ env.IS_PRERELEASE }}

.github/workflows/tests.yml

+18-9
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,21 @@ jobs:
1111
unit:
1212
runs-on: macos-latest
1313
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-node@v4
16-
with:
17-
node-version: 20
18-
cache: npm
19-
- name: Install modules
20-
run: npm install
21-
- name: Run tests
22-
run: npm run test -- --coverage
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
cache: npm
19+
- name: Install modules
20+
run: npm install
21+
- name: Run tests
22+
run: npm run test -- --coverage --coverage-reporter lcov
23+
- name: Upload coverage to Codecov
24+
uses: codecov/codecov-action@v4
25+
with:
26+
files: ./coverage/lcov.info
27+
flags: unittests
28+
fail_ci_if_error: false
29+
verbose: true
30+
env:
31+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ node_modules/
44
/.data/
55
gl-prettier-codequality.json
66
/.eslintcache
7+
/coverage/

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## v2.1.0-alpha.0 - 2024.12.11
10+
11+
### Added
12+
13+
- Add support for syntax errors ([#42](https://github.com/studiometa/prettier-formatter-gitlab/issues/42), [#43](https://github.com/studiometa/prettier-formatter-gitlab/pull/43), [08fde17](https://github.com/studiometa/prettier-formatter-gitlab/commit/08fde17))
14+
915
## v2.0.0 - 2024.04.16
1016

1117
### Changed

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# Prettier formatter for GitLab Code Quality
1+
# @studiometa/prettier-formatter-gitlab
22

3-
[![NPM Version](https://img.shields.io/npm/v/@studiometa/prettier-formatter-gitlab.svg?style=flat-square)](https://www.npmjs.com/package/@studiometa/prettier-formatter-gitlab/)
3+
[![NPM Version](https://img.shields.io/npm/v/@studiometa/prettier-formatter-gitlab.svg?style=flat&colorB=3e63dd&colorA=414853)](https://www.npmjs.com/package/@studiometa/prettier-formatter-gitlab/)
4+
[![Downloads](https://img.shields.io/npm/dm/@studiometa/prettier-formatter-gitlab?style=flat&colorB=3e63dd&colorA=414853)](https://www.npmjs.com/package/@studiometa/prettier-formatter-gitlab/)
5+
[![Size](https://img.shields.io/bundlephobia/minzip/@studiometa/prettier-formatter-gitlab?style=flat&colorB=3e63dd&colorA=414853&label=size)](https://bundlephobia.com/package/@studiometa/prettier-formatter-gitlab)
6+
[![Dependency Status](https://img.shields.io/librariesio/release/npm/@studiometa/prettier-formatter-gitlab?style=flat&colorB=3e63dd&colorA=414853)](https://david-dm.org/studiometa/prettier-formatter-gitlab)
7+
![Codecov](https://img.shields.io/codecov/c/github/studiometa/prettier-formatter-gitlab?style=flat&colorB=3e63dd&colorA=414853)
48

5-
> Send Prettier errors to Gitlab's Code Quality reports.
9+
Send Prettier errors to Gitlab's Code Quality reports.
610

711
## Installation
812

@@ -24,11 +28,11 @@ The report file path will be read from the `PRETTIER_CODE_QUALITY_REPORT` enviro
2428

2529
```yaml
2630
# .gitlab-ci.yml
27-
eslint:
31+
prettier:
2832
image: node:20
2933
script:
3034
- npm ci
31-
- prettier-formatter-gitlab 'prettier -l src/'
35+
- npx prettier-formatter-gitlab 'prettier -l src/'
3236
artifacts:
3337
reports:
3438
codequality: gl-codequality.json

bin/cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if (cmd) {
88
exec(cmd, async (error, stdout, stderr) => {
99
if (error) {
1010
console.log(error.message);
11-
await prettierFormatterGitLab(stderr || stdout);
11+
await prettierFormatterGitLab(stdout + stderr);
1212
process.exit(1);
1313
}
1414
});

0 commit comments

Comments
 (0)