Skip to content

Commit c42e9d0

Browse files
authored
Merge pull request #101 from willingc/review-config
Update gitignore, flake8, and pre-commit config files
2 parents 0d83fe3 + 16d2013 commit c42e9d0

File tree

3 files changed

+164
-45
lines changed

3 files changed

+164
-45
lines changed

.flake8

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
[flake8]
2-
ignore = E203, W503
2+
# Ignore
3+
# E203: whitespace before `,` `;` or `:`
4+
# E266: too many leading # for block comment
5+
# E501: line too long
6+
# E701: Multiple statements on one line (colon)
7+
# W503: line break after binary operator
8+
ignore = E203, E266, E501, E701, E704, W503
9+
max-complexity = 18

.gitignore

Lines changed: 134 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,116 @@
1-
.DS_Store
2-
contrib*.yml
3-
pack*.yml
4-
*.pickle
5-
all_contribs.pickle
6-
all_contribs_dict.pickle
7-
.env
8-
.vscode/
9-
.idea/
10-
.token
11-
__pycache__
12-
.coverage
13-
coverage.xml
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
145

6+
# C extensions
7+
*.so
158

169
# Distribution / packaging
1710
.Python
1811
build/
12+
develop-eggs/
1913
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
2084

2185
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
2288
.python-version
2389

90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
111+
112+
113+
24114
# Environments
25115
.env
26116
.venv
@@ -30,19 +120,41 @@ ENV/
30120
env.bak/
31121
venv.bak/
32122

123+
# Spyder project settings
124+
.spyderproject
125+
.spyproject
126+
127+
33128
# mypy
34129
.mypy_cache/
35130
.dmypy.json
36131
dmypy.json
37132

38-
token.txt
133+
# Pyre type checker
134+
.pyre/
135+
136+
# pytype static type analyzer
137+
.pytype/
138+
139+
# Cython debug symbols
140+
cython_debug/
141+
142+
# PyCharm
143+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
144+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
145+
# and can be added to the global gitignore or merged into this file. For a more nuclear
146+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
147+
.idea/
148+
149+
# macOS
150+
.DS_Store
151+
152+
# vscode editor
153+
.vscode/
154+
155+
# pyosMeta specific
39156
src/pyosmeta/_version.py
157+
*.pickle
40158

41-
# local files
42-
all-submissions.csv
43-
issue-stats.ipynb
44-
plot.py
45-
presubmissions.csv
46-
reviews_all.csv
47-
reviews_presubmissions.csv
48-
src/pyosmeta/cli/test.ipynb
159+
.token
160+
token.txt

.pre-commit-config.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
1-
# pre-commit is a tool that you run locally
2-
# to perform a predefined set of tasks manually and/or
3-
# automatically before git commits are made.
4-
# Here we are using pre-commit with the precommit.ci bot to implement
5-
# code fixes automagically in pr's. You will still want to install pre-commit
6-
# to run locally
7-
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
8-
# To run on a pr, add a comment with the text "pre-commit.ci run"
9-
# Common tasks
10-
#
11-
# - Run on all files: pre-commit run --all-files
12-
# - Register git hooks: pre-commit install --install-hooks
1+
# pre-commit (https://pre-commit.com/) is a tool that runs source code checks
2+
# such as linting, formatting, and code style.
3+
4+
# CI
5+
# pyosMeta uses pre-commit with the precommit.ci bot to check pull requests.
6+
# Configuration reference doc: https://pre-commit.com/#pre-commit-configyaml---top-level
7+
8+
# Developers
9+
# You may want to install pre-commit to run locally on each minimum_pre_commit_version
10+
# See https://pre-commit.com/#install
11+
# To set up pre-commit hooks: pre-commit install
12+
# To run on all files: pre-commit run --all-files
1313

1414
ci:
15+
# pyosMeta disables autofixing of PRs to simplify new contributor experience and cleaner git history
1516
autofix_prs: false
16-
#skip: [flake8, end-of-file-fixer]
17-
autofix_commit_msg: |
18-
'[pre-commit.ci 🤖] Apply code format tools to PR'
19-
# Update hook versions every quarter (so we don't get hit with weekly update pr's)
17+
# Frequency of hook updates
2018
autoupdate_schedule: weekly
2119

2220
repos:
23-
# Misc commit checks
21+
# Out of the box hooks for pre-commit https://github.com/pre-commit/pre-commit-hooks
2422
- repo: https://github.com/pre-commit/pre-commit-hooks
2523
rev: v4.5.0
26-
# ref: https://github.com/pre-commit/pre-commit-hooks#hooks-available
2724
hooks:
28-
# Autoformat: Makes sure files end in a newline and only a newline.
25+
# Makes sure files end in a newline and only a newline.
2926
- id: end-of-file-fixer
30-
# Lint: Check for files with names that would conflict on a
31-
# case-insensitive filesystem like MacOS HFS+ or Windows FAT.
27+
# Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT.
3228
- id: check-case-conflict
29+
# Remove trailing whitespace on code lines
3330
- id: trailing-whitespace
3431

32+
# Spelling hook
3533
- repo: https://github.com/codespell-project/codespell
3634
rev: v2.2.6
3735
hooks:
3836
- id: codespell
3937
additional_dependencies:
4038
- tomli
4139

42-
# Linting: Python code (see the file .flake8)
40+
# Linting hook for Python code (see the file .flake8)
4341
- repo: https://github.com/PyCQA/flake8
4442
rev: "7.0.0"
4543
hooks:
4644
- id: flake8
4745

46+
# Code formatting hook
4847
- repo: https://github.com/psf/black
4948
rev: 24.2.0
5049
hooks:
5150
- id: black
5251

52+
# Best practice style for module imports
5353
- repo: https://github.com/PyCQA/isort
5454
rev: 5.13.2
5555
hooks:

0 commit comments

Comments
 (0)