Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Jul 5, 2023
0 parents commit f246a19
Show file tree
Hide file tree
Showing 32 changed files with 9,779 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[report]
exclude_lines =
pragma: no cover
if\s+(typing\.)?TYPE_CHECKING:
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

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

[{*.yaml,*.yml}]
indent_size = 2
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
9 changes: 9 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* @lars-reimann

# Documentation
/docs/ @Safe-DS/Library-Analysis
/mkdocs.yml @Safe-DS/Library-Analysis

# Code
/src/ @Safe-DS/Library-Analysis
/tests/ @Safe-DS/Library-Analysis
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# root
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'monthly'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'monthly'
- package-ecosystem: 'pip'
directory: '/'
schedule:
interval: 'monthly'
10 changes: 10 additions & 0 deletions .github/linters/.markdown-link-check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ignorePatterns": [
{
"pattern": "^(http|https)://localhost"
},
{
"pattern": "^#"
}
]
}
4 changes: 4 additions & 0 deletions .github/linters/.mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[mypy]
disallow_incomplete_defs = true
disallow_untyped_defs = true
ignore_missing_imports = true
106 changes: 106 additions & 0 deletions .github/linters/.ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
ignore-init-module-imports = true
line-length = 120
target-version = "py310"

select = [
"F",
"E",
"W",
"I",
"N",
"D",
"UP",
"YTT",
"BLE",
"FBT",
"B",
"A",
"COM",
"C4",
"DTZ",
"T10",
"ISC",
"ICN",
"G",
"INP",
"PIE",
"T20",
"PYI",
"PT",
"Q",
"RSE",
"RET",
"SLF",
"SIM",
"TID",
"TCH",
"INT",
"ARG",
"PTH",
"PGH",
"PL",
"TRY",
"RUF"
]
ignore = [
# line-too-long (handled by black)
"E501",
# tab-indentation (handled by black)
"W191",
# trailing-whitespace (handled by black)
"W291",
# missing-newline-at-end-of-file (handled by black)
"W292",
# blank-line-with-witespace (handled by black)
"W293",
# boolean-positional-arg-in-function-definition (we leave it to the call-site)
"FBT001",
# boolean-default-value-in-function-definition (we leave it to the call-site)
"FBT002",
# builtin-attribute-shadowing (not an issue)
"A003",
# implicit-return (can add a return even though all cases are covered)
"RET503",
# superfluous-else-return (sometimes it's more readable)
"RET505",
# superfluous-else-raise (sometimes it's more readable)
"RET506",
# superfluous-else-continue (sometimes it's more readable)
"RET507",
# superfluous-else-break (sometimes it's more readable)
"RET508",
# private-member-access (we cannot always avoid it if we want a clean API)
"SLF001",
# if-else-block-instead-of-if-exp (an if-else block can be more readable)
"SIM108",
# compare-to-empty-string (sometimes it's better to be explicit)
"PLC1901",
# too-many-return-statements
"PLR0911",
# too-many-branches
"PLR0912",
# too-many-arguments
"PLR0913",
# too-many-statements
"PLR0915",
# magic-value-comparison
"PLR2004",
# raise-vanilla-args
"TRY003",
]

[per-file-ignores]
"*test*.py" = [
# Undocumented declarations
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
]

[pydocstyle]
convention = "numpy"
6 changes: 6 additions & 0 deletions .github/linters/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "stylelint-config-standard",
"rules": {
"selector-class-pattern": null
}
}
11 changes: 11 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Dependency Review

on:
pull_request:
branches: [ main ]
merge_group:

jobs:
dependency-review:
if: ${{ github.event_name == 'pull_request' }}
uses: lars-reimann/.github/.github/workflows/dependency-review-reusable.yml@main
15 changes: 15 additions & 0 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Add Issues to Library Analysis Project

on:
issues:
types:
- opened

jobs:
add-to-project:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/Safe-DS/projects/4
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Main

on:
push:
branches: [ main ]

jobs:
poetry-with-codecov:
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
uses: lars-reimann/.github/.github/workflows/poetry-codecov-reusable.yml@main
with:
working-directory: .
python-version: ${{ matrix.python-version }}
module-name: safeds_stubgen
coverage: ${{ matrix.python-version == '3.10' }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/megalinter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: MegaLinter

on:
pull_request:
branches: [main]
merge_group:

jobs:
megalinter:
if: ${{ github.event_name == 'pull_request' }}
uses: lars-reimann/.github/.github/workflows/megalinter-reusable.yml@main
secrets:
PAT: ${{ secrets.PAT }}
15 changes: 15 additions & 0 deletions .github/workflows/pr-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Pull Request Format

on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened
merge_group:

jobs:
check-format:
if: ${{ github.event_name == 'pull_request_target' }}
uses: lars-reimann/.github/.github/workflows/pr-format-reusable.yml@main
26 changes: 26 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pull Request

on:
pull_request:
branches: [ main ]

concurrency:
group: ${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
poetry-with-codecov:
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
uses: lars-reimann/.github/.github/workflows/poetry-codecov-reusable.yml@main
with:
working-directory: .
python-version: ${{ matrix.python-version }}
module-name: safeds_stubgen
coverage: ${{ matrix.python-version == '3.10' }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Release to PyPI

on:
workflow_dispatch

jobs:
release:
uses: lars-reimann/.github/.github/workflows/poetry-pypi-reusable.yml@main
with:
working-directory: .
python-version: "3.10"
secrets:
GITHUB_PAT: ${{ secrets.PAT }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# IntelliJ
.idea/
*.iml

# VSCode Settings
.vscode/

# Compilation/build outputs
build/
dist/
out/

# Node
.npm/
node_modules/
.node_repl_history
npm-debug.log*
pnpm-lock.yaml
yarn.lock

# Python binaries
*.egg-info/
__pycache__/
*.pyc

# Python environment
venv/

# Pytest outputs
.pytest_cache/
htmlcov/
.coverage
coverage.xml

# ruff
.ruff_cache/

# mkdocs
/site/

# MegaLinter
report/
megalinter-reports/

# Other
.DS_Store
*.log
21 changes: 21 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See all available variables at https://megalinter.github.io/configuration/ and in linters documentation.

EXTENDS: https://raw.githubusercontent.com/lars-reimann/.github/main/.mega-linter.yml

# Config
FILTER_REGEX_EXCLUDE: (\.github/workflows/|mkdocs.yml)

# Workaround to also run prettier on other supported file types. We deactivate it for Markdown compared to the extended
# configuration since it breaks admonitions of Material for MkDocs.
JSON_PRETTIER_FILE_EXTENSIONS:
- .json
- .css
- .scss
- .htm
- .html
# - .md

# Commands
PRE_COMMANDS:
- command: npm install @lars-reimann/prettier-config
cwd: workspace
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Lars Reimann

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.
Empty file added docs/CHANGELOG.md
Empty file.
Empty file added docs/README.md
Empty file.
Loading

0 comments on commit f246a19

Please sign in to comment.