Skip to content

Commit 9349e21

Browse files
committed
feat: add license, docs and workflows for open source
1 parent e23f189 commit 9349e21

14 files changed

+1125
-8
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Issue Template
2+
3+
## Expected Behavior
4+
Describe what you expected to happen.
5+
6+
## Current Behavior
7+
Describe what actually happens.
8+
9+
## Steps to Reproduce
10+
1.
11+
2.
12+
3.
13+
14+
## Possible Solution
15+
(Optional) Suggest a fix or reason for the bug.
16+
17+
## Context (Environment)
18+
- OS:
19+
- Python version:
20+
- Any other relevant context:

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/pull_request_template.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Pull Request Template
2+
3+
## Description
4+
Please include a summary of the change and which issue is fixed. Also include relevant motivation and context.
5+
6+
Fixes # (issue)
7+
8+
## Type of change
9+
- [ ] Bug fix
10+
- [ ] New feature
11+
- [ ] Documentation update
12+
- [ ] Other (describe):
13+
14+
## Checklist
15+
- [ ] My code follows the style guidelines of this project
16+
- [ ] I have performed a self-review of my code
17+
- [ ] I have commented my code, particularly in hard-to-understand areas
18+
- [ ] I have made corresponding changes to the documentation
19+
- [ ] My changes generate no new warnings
20+
- [ ] I have added tests that prove my fix is effective or that my feature works (if applicable)
21+
- [ ] New and existing unit tests pass locally with my changes (if applicable)
22+
23+
## Additional context
24+
Add any other context or screenshots about the pull request here.

.github/workflows/codeql.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '0 0 * * 0'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
language: [ 'python' ]
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
- name: Initialize CodeQL
27+
uses: github/codeql-action/init@v3
28+
with:
29+
languages: ${{ matrix.language }}
30+
- name: Autobuild
31+
uses: github/codeql-action/autobuild@v3
32+
- name: Perform CodeQL Analysis
33+
uses: github/codeql-action/analyze@v3
34+
with:
35+
category: "/language:${{matrix.language}}"

.github/workflows/pre-commit.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: pre-commit
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.11'
18+
- name: Install pre-commit
19+
run: pip install pre-commit
20+
- name: Run pre-commit
21+
run: pre-commit run --all-files --show-diff-on-failure

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# .gitignore
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
env/
14+
build/
15+
develop-eggs/
16+
dist/
17+
downloads/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
29+
# Installer logs
30+
pip-log.txt
31+
pip-delete-this-directory.txt
32+
33+
# Unit test / coverage reports
34+
htmlcov/
35+
.tox/
36+
.nox/
37+
.coverage
38+
.coverage.*
39+
.cache
40+
nosetests.xml
41+
coverage.xml
42+
*.cover
43+
.hypothesis/
44+
.pytest_cache/
45+
46+
# Jupyter Notebook
47+
.ipynb_checkpoints
48+
49+
# VS Code
50+
.vscode/
51+
52+
# MacOS
53+
.DS_Store
54+
55+
# Anki backups
56+
anki/*.bak
57+
anki/*.apkg
58+
59+
# Misc
60+
*.swp
61+
*~

.pre-commit-config.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
repos:
2+
- repo: https://github.com/gitleaks/gitleaks
3+
rev: v8.18.2
4+
hooks:
5+
- id: gitleaks
6+
name: gitleaks - detect secrets and sensitive data
7+
stages: [ commit, push ]
8+
- repo: https://github.com/psf/black
9+
rev: 24.4.2
10+
hooks:
11+
- id: black
12+
language_version: python3
13+
- repo: https://github.com/astral-sh/ruff-pre-commit
14+
rev: v0.4.4
15+
hooks:
16+
- id: ruff
17+
args: [ --fix ]
18+
- repo: https://github.com/PyCQA/bandit
19+
rev: 1.7.8
20+
hooks:
21+
- id: bandit
22+
name: bandit - security linter for python
23+
entry: bandit -r problems scripts
24+
language: python
25+
types: [ python ]
26+
- repo: https://github.com/pre-commit/pre-commit-hooks
27+
rev: v4.5.0
28+
hooks:
29+
- id: end-of-file-fixer
30+
- id: trailing-whitespace
31+
- id: check-yaml
32+
- id: check-added-large-files
33+
- id: check-merge-conflict
34+
- id: check-json
35+
- id: check-docstring-first
36+
- id: check-case-conflict
37+
- id: check-symlinks
38+
- id: debug-statements
39+
- repo: https://github.com/igorshubovych/markdownlint-cli
40+
rev: v0.39.0
41+
hooks:
42+
- id: markdownlint
43+
name: markdownlint for docs and README
44+
entry: markdownlint README.md docs/**/*.md anki/*.md problems/**/*.md
45+
language: node
46+
types: [ markdown ]

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]
8+
- Initial public release
9+
- Added open source documentation, automation, and security workflows

CODE_OF_CONDUCT.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone.
5+
6+
## Our Standards
7+
- Be respectful and considerate.
8+
- Refrain from demeaning, discriminatory, or harassing behavior and speech.
9+
- Accept constructive criticism gracefully.
10+
- Show empathy towards other community members.
11+
12+
## Enforcement
13+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the maintainer at [GitHub Issues](https://github.com/scarowar/scars-of-leetcode/issues).
14+
15+
## Attribution
16+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/).

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing to scars-of-leetcode
2+
3+
Thank you for considering contributing! We welcome all kinds of contributions, including bug fixes, new solutions, documentation improvements, and more.
4+
5+
## How to Contribute
6+
1. **Fork the repository** and create your branch from `main`.
7+
2. **Add your solution, flashcard, or improvement** in the appropriate folder.
8+
3. **Write clear commit messages** and document your code.
9+
4. **Open a Pull Request** with a clear description of your changes.
10+
11+
## Guidelines
12+
- Follow the existing file and folder structure.
13+
- Use clear, descriptive names for files and functions.
14+
- Add comments and documentation where helpful.
15+
- If adding a new problem solution, include a `README.md` and `cards.json` if possible.
16+
- Be respectful and constructive in code reviews and discussions.
17+
18+
## Reporting Issues
19+
If you find a bug or have a feature request, please [open an issue](https://github.com/scarowar/scars-of-leetcode/issues).
20+
21+
## Code of Conduct
22+
This project and everyone participating is expected to follow our [Code of Conduct](CODE_OF_CONDUCT.md).
23+
24+
## License
25+
By contributing, you agree that your contributions will be licensed under the GNU General Public License v3.0 (GPL-3.0).

0 commit comments

Comments
 (0)