Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support outputting Clang compilation database #9

Merged
merged 5 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
* @raphael-theriault-swi @solarwindscloud/apm-instrumentation

# as of Sept 2023, remove after GH EMU move (see below)
* @solarwindscloud/eng-apm-instrumentation
* @raphael-theriault-swi @solarwindscloud/eng-apm-instrumentation

# placeholder for GH EMU where this will move to new org for public repos
* @solarwinds/eng-apm-instrumentation
# * @solarwinds/eng-apm-instrumentation
7 changes: 4 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 18
cache: npm
- run: npm ci

- run: npm run lint
- run: npm run build
- run: npm run lint
- run: npm run test
7 changes: 4 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: configure git
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"

- uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 18
registry-url: https://registry.npmjs.org
- run: npm ci

- run: npm run lint
- run: npm run build
- run: npm run lint
- run: npm run test

- run: npm version ${{ inputs.version }}
- run: git push origin main --follow-tags
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode/
node_modules/
dist/
35 changes: 9 additions & 26 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require("node:path")
const fs = require("node:fs")

const eslint = require("@eslint/js")
const globals = require("globals")
const prettier = require("eslint-config-prettier")
const typescriptParser = require("@typescript-eslint/parser")
Expand All @@ -11,14 +12,9 @@ const headerPlugin = require("eslint-plugin-header")

const license = fs.readFileSync(path.join(__dirname, "LICENSE"), "utf8")

const mapRules = (rules, oldKey = "", newKey = "") =>
Object.fromEntries(
Object.entries(rules).map(([k, v]) => [k.replace(oldKey, newKey), v]),
)

module.exports = [
{ ignores: ["dist/**"] },
"eslint:recommended",
eslint.configs.recommended,
{
files: ["**/*.js"],
languageOptions: {
Expand All @@ -30,32 +26,19 @@ module.exports = [
files: ["**/*.ts"],
languageOptions: {
parser: typescriptParser,
parserOptions: { project: ["./tsconfig.json"] },
parserOptions: { project: true },
},
plugins: {
ts: typescriptPlugin,
"@typescript-eslint": typescriptPlugin,
tsdoc: tsdocPlugin,
imports: importsPlugin,
},
rules: {
...typescriptPlugin.configs["eslint-recommended"].overrides[0].rules,
...mapRules(
typescriptPlugin.configs["recommended"].rules,
"@typescript-eslint",
"ts",
),
...mapRules(
typescriptPlugin.configs["recommended-requiring-type-checking"].rules,
"@typescript-eslint",
"ts",
),
...mapRules(
typescriptPlugin.configs["strict"].rules,
"@typescript-eslint",
"ts",
),
"ts/no-non-null-assertion": "off",
"ts/consistent-type-imports": [
...typescriptPlugin.configs["strict-type-checked"].rules,
...typescriptPlugin.configs["stylistic-type-checked"].rules,
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
],
Expand All @@ -70,5 +53,5 @@ module.exports = [
"header/header": ["error", "block", `\n${license.trim()}\n`],
},
},
{ rules: prettier.rules },
prettier,
]
Loading