Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing committed Jul 20, 2023
0 parents commit 0cb8700
Show file tree
Hide file tree
Showing 12 changed files with 3,877 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 100
trim_trailing_whitespace = true

[COMMIT_EDITMSG]
max_line_length = 72
73 changes: 73 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: ci

on:
pull_request:
push:
branches: [main]
tags: ['*']

jobs:
pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- run: npm pack
- uses: actions/upload-artifact@v3
with:
name: package
path: '*.tgz'

prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- run: npx prettier --check .

remark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- run: npx remark --frail .

tsc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- run: npx tsc

release:
runs-on: ubuntu-latest
needs:
- pack
- prettier
- remark
- tsc
if: startsWith(github.ref, 'refs/tags/')
permissions:
id-token: write
steps:
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org
- uses: actions/download-artifact@v3
with: { name: package }
- run: npm publish *.tgz --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
4 changes: 4 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
proseWrap: always
semi: false
singleQuote: true
trailingComma: none
2 changes: 2 additions & 0 deletions .remarkrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
plugins:
- remark-preset-remcohaszing
18 changes: 18 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# MIT License

Copyright © 2023 Remco Haszing

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the “Software”), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# codeclimate-types

[![github actions](https://github.com/remcohaszing/codeclimate-types/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/codeclimate-types/actions/workflows/ci.yaml)
[![npm version](https://img.shields.io/npm/v/codeclimate-types)](https://www.npmjs.com/package/codeclimate-types)
[![npm downloads](https://img.shields.io/npm/dm/codeclimate-types)](https://www.npmjs.com/package/codeclimate-types)

TypeScript type definitions for
[Code Climate reports](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md)

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [API](#api)
- [Related Projects](#related-projects)
- [License](#license)

## Installation

```sh
npm install codeclimate-types
```

## Usage

This package can be used to work with
[Code Climate reports](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#issues)
in a type-safe manner. A practical use case is to generate a
[GitLab code quality](https://docs.gitlab.com/ee/ci/testing/code_quality.html) artifact.

## API

The package exports the following types:

- `Issue` — An issue represents a single instance of a real or potential code problem, detected by a
static analysis Engine.
- `Category` — Issues must be associated with one or more categories.
- `Location` — Locations refer to ranges of a source code file.
- `Position` — Positions refer to specific characters within a source file.
- `Content` — Content gives more information about the issue’s check.
- `Trace` — Some engines require the ability to refer to other source locations in describing an
issue.
- `Severity` — A severity string describing the potential impact of the issue found.

## Related Projects

- [`eslint-formatter-gitlab`](https://gitlab.com/remcohaszing/eslint-formatter-gitlab) — Show ESLint
results directly in the GitLab code quality results

## License

[MIT](LICENSE.md) © [Remco Haszing](https://github.com/remcohaszing)
Loading

0 comments on commit 0cb8700

Please sign in to comment.