-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
697 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@spear-ai/sqlfluff-config": major | ||
--- | ||
|
||
Created SQLFluff config package. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.ruff_cache | ||
.turbo | ||
.venv | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# @spear-ai/sqlfluff-config | ||
|
||
A [SQLFluff](https://sqlfluff.com) config. | ||
|
||
## Installation | ||
|
||
```shell | ||
poetry add -D spear_ai_sqlfluff_config | ||
``` | ||
|
||
## Usage | ||
|
||
Configure `poetry.toml` to save the virtual environment to your local project: | ||
|
||
``` | ||
[virtualenvs] | ||
in-project = true | ||
``` | ||
|
||
Copy the following to your `.sqluff` file: | ||
|
||
```shell | ||
cp ./.venv/lib/python3.11/site-packages/spear-ai-sqlfluff-config/.sqlfluff .sqlfluff | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { baseEslintConfig, prettierConfig } from "@spear-ai/eslint-config"; | ||
|
||
/** @type {import("eslint").Linter.FlatConfig} */ | ||
const eslintConfig = [ | ||
{ | ||
ignores: ["dist", "node_modules", ".venv"], | ||
}, | ||
...baseEslintConfig, | ||
prettierConfig, | ||
]; | ||
|
||
export default eslintConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
extends: ["@spear-ai/npm-package-json-lint-config/spear-library"], | ||
rules: { | ||
"prefer-absolute-version-devDependencies": "off", | ||
"prefer-alphabetical-scripts": "off", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "@spear-ai/sqlfluff-config", | ||
"version": "0.0.0", | ||
"description": "Spear AI SQLFluff config", | ||
"author": { | ||
"name": "Spear AI", | ||
"email": "[email protected]", | ||
"url": "https://spear.ai" | ||
}, | ||
"type": "module", | ||
"devDependencies": { | ||
"@types/eslint": "8.56.9", | ||
"@types/regenerator-runtime": "^0.13.5", | ||
"eslint": "8.57.0", | ||
"graphql": "16.8.1", | ||
"npm-package-json-lint": "7.1.0", | ||
"prettier": "3.2.5", | ||
"react": "18.2.0", | ||
"regenerator-runtime": "^0.14.1", | ||
"replace-in-file": "^7.1.0", | ||
"tailwindcss": "3.4.3", | ||
"tsup": "8.0.2", | ||
"tsx": "4.7.2", | ||
"typescript": "5.4.5" | ||
}, | ||
"license": "MIT", | ||
"private": true, | ||
"repository": { | ||
"type": "git", | ||
"directory": "packages/sqlfluff-config", | ||
"url": "https://github.com/spear-ai/citizen.git" | ||
}, | ||
"scripts": { | ||
"build": "poetry build", | ||
"eslint:check": "eslint --max-warnings 0 .", | ||
"eslint:fix": "yarn eslint:check --fix", | ||
"npmpkgjsonlint:check": "npmPkgJsonLint .", | ||
"postinstall": "poetry install", | ||
"prettier:check": "prettier --check .", | ||
"prettier:fix": "prettier --write .", | ||
"publish-package": "poetry publish --skip-existing", | ||
"sync-version": "tsx sync-version", | ||
"typescript:check": "tsc --noEmit" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[virtualenvs] | ||
in-project = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[tool.poetry] | ||
name = "spear-ai-sqlfluff-config" | ||
version = "0.0.0" | ||
description = "Spear AI Ruff config" | ||
authors = ["Spear AI <[email protected]>"] | ||
keywords = [ | ||
"ai", | ||
"config", | ||
"SQLFluff", | ||
"spear" | ||
] | ||
packages = [{ include = "spear_ai_sqlfluff_config" }] | ||
readme = "README.md" | ||
repository = "https://github.com/spear-ai/citizen" | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.10,<3.13" | ||
sqlfluff = "^3.0.6" | ||
|
||
[build-system] | ||
build-backend = "poetry.core.masonry.api" | ||
requires = ["poetry-core>=1.0.0"] |
37 changes: 37 additions & 0 deletions
37
packages/sqlfluff-config/spear_ai_sqlfluff_config/.sqlfluff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[sqlfluff] | ||
dialect = postgres | ||
max_line_length = 120 | ||
templater = placeholder | ||
|
||
[sqlfluff:templater:placeholder] | ||
DATABASE_OWNER=owner_role | ||
param_style = colon | ||
|
||
[sqlfluff:rules:ambiguous.column_references] | ||
group_by_and_order_by_style = explicit | ||
|
||
[sqlfluff:rules:ambiguous.join] | ||
fully_qualify_join_types = both | ||
|
||
[sqlfluff:rules:capitalisation.functions] | ||
capitalisation_policy = lower | ||
extended_capitalisation_policy = lower | ||
|
||
[sqlfluff:rules:capitalisation.identifiers] | ||
capitalisation_policy = lower | ||
extended_capitalisation_policy = lower | ||
|
||
[sqlfluff:rules:capitalisation.literals] | ||
capitalisation_policy = upper | ||
|
||
[sqlfluff:rules:capitalisation.keywords] | ||
capitalisation_policy = upper | ||
|
||
[sqlfluff:rules:capitalisation.types] | ||
extended_capitalisation_policy = lower | ||
|
||
[sqlfluff:rules:convention.casting_style] | ||
preferred_type_casting_style = shorthand | ||
|
||
[sqlfluff:rules:references.consistent] | ||
single_table_references = unqualified |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Spear AI SQLFluff config.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
/* eslint-disable regexp/require-unicode-regexp */ | ||
/* eslint-disable regexp/require-unicode-sets-regexp */ | ||
|
||
import replaceInFile from "replace-in-file"; | ||
import package_ from "./package.json" assert { type: "json" }; | ||
|
||
await replaceInFile({ | ||
files: "pyproject.toml", | ||
from: /version = ".*"/, | ||
to: `version = "${package_.version}"`, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"exclude": ["node_modules"], | ||
"extends": "@spear-ai/tsconfig", | ||
"include": [ | ||
"**/*.cjs", | ||
"**/*.cts", | ||
"**/*.js", | ||
"**/*.jsx", | ||
"**/*.jsx", | ||
"**/*.mjs", | ||
"**/*.mts", | ||
"**/*.ts", | ||
"**/*.tsx", | ||
"types" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters