Skip to content

Commit 24fb526

Browse files
authored
Merge pull request #116 from Tieqiong/pcmt
style: using new precommit
2 parents f6c2aaf + 3d40d9b commit 24fb526

20 files changed

+270
-238
lines changed

.codecov.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
coverage:
22
status:
3-
project: # more options at https://docs.codecov.com/docs/commit-status
3+
project: # more options at https://docs.codecov.com/docs/commit-status
44
default:
55
target: auto # use the coverage from the base commit, fail if coverage is lower
6-
threshold: 0% # allow the coverage to drop by
6+
threshold: 0% # allow the coverage to drop by
77

88
comment:
99
layout: " diff, flags, files"
1010
behavior: default
1111
require_changes: false
12-
require_base: false # [true :: must have a base report to post]
13-
require_head: false # [true :: must have a head report to post]
12+
require_base: false # [true :: must have a base report to post]
13+
require_head: false # [true :: must have a head report to post]
1414
hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage]

.github/ISSUE_TEMPLATE/release_checklist.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,34 @@ assignees: ""
1212
- [ ] All the badges on the README are passing.
1313
- [ ] License information is verified as correct. If you are unsure, please comment below.
1414
- [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are
15-
missing), tutorials, and other human written text is up-to-date with any changes in the code.
15+
missing), tutorials, and other human written text is up-to-date with any changes in the code.
1616
- [ ] Installation instructions in the README, documentation and on the website (e.g., diffpy.org) are updated.
1717
- [ ] Successfully run any tutorial examples or do functional testing with the latest Python version.
1818
- [ ] Grammar and writing quality are checked (no typos).
1919

2020
Please mention @sbillinge here when you are ready for PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here:
2121

22-
### PyPI/GitHub full-release preparation checklist:
22+
### PyPI/GitHub full-release preparation checklist:
23+
2324
- [ ] Create a new conda environment and install the rc from pypi (`pip install <package-name>=??`)
2425
- [ ] License information at Pypi is verified as correct.
2526
- [ ] Docs deployed successfully to `<package-name>.github.io`
2627
- [ ] Successfully run all tests, tutorial examples or do functional testing
2728

28-
Please let @sbillinge know that all checks are done and package is ready for full release.
29+
Please let @sbillinge know that all checks are done and package is ready for full release.
2930

3031
### conda-forge release preparation checklist:
3132

3233
<!-- After @sbillinge releases the PyPI package, please check the following when creating a PR for conda-forge release.-->
3334

3435
- [ ] Ensure that the full release has appeared on Pypi successfully
3536
- [ ] New package dependencies listed in `conda.txt` and `test.txt` are added to `meta.yaml` in the feedstock.
36-
- [ ] Close any open issues on the feedstock. Reach out to @bobleesj if you have questions
37+
- [ ] Close any open issues on the feedstock. Reach out to @bobleesj if you have questions
3738
- [ ] let @sbillinge and @bobleesj when this is ready
3839

3940
### Post-release checklist
4041

4142
<!-- Before closing this issue, please complete the following: -->
4243

43-
- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments.
44-
- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures.
44+
- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments.
45+
- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures.

.github/workflows/build-wheel-release-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
tags:
7-
- '*' # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml
7+
- "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml
88

99
jobs:
1010
release:

.github/workflows/check-news-item.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Check for News
33
on:
44
pull_request_target:
55
branches:
6-
- main
6+
- main
77

88
jobs:
99
check-news-item:

.pre-commit-config.yaml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
default_language_version:
2-
python: python3
2+
python: python3
33
ci:
4-
autofix_commit_msg: |
5-
[pre-commit.ci] auto fixes from pre-commit hooks
6-
autofix_prs: true
7-
autoupdate_branch: 'pre-commit-autoupdate'
8-
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
9-
autoupdate_schedule: monthly
10-
skip: [no-commit-to-branch]
11-
submodules: false
4+
autofix_commit_msg: |
5+
[pre-commit.ci] auto fixes from pre-commit hooks
6+
autofix_prs: true
7+
autoupdate_branch: "pre-commit-autoupdate"
8+
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
9+
autoupdate_schedule: monthly
10+
skip: [no-commit-to-branch]
11+
submodules: false
1212
repos:
1313
- repo: https://github.com/pre-commit/pre-commit-hooks
1414
rev: v4.6.0
@@ -47,6 +47,20 @@ repos:
4747
- repo: https://github.com/codespell-project/codespell
4848
rev: v2.3.0
4949
hooks:
50-
- id: codespell
51-
additional_dependencies:
52-
- tomli
50+
- id: codespell
51+
additional_dependencies:
52+
- tomli
53+
# prettier - multi formatter for .json, .yml, and .md files
54+
- repo: https://github.com/pre-commit/mirrors-prettier
55+
rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8
56+
hooks:
57+
- id: prettier
58+
additional_dependencies:
59+
- "prettier@^3.2.4"
60+
# docformatter - PEP 257 compliant docstring formatter
61+
- repo: https://github.com/s-weigand/docformatter
62+
rev: 5757c5190d95e5449f102ace83df92e7d3b06c6c
63+
hooks:
64+
- id: docformatter
65+
additional_dependencies: [tomli]
66+
args: [--in-place, --config, ./pyproject.toml]

doc/source/examples/Ni_calculation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3+
"""Calculate PDF of FCC nickel.
34
4-
"""Calculate PDF of FCC nickel. Save data to Ni_calculation.cgr and plot it using matplotlib.
5+
Save data to Ni_calculation.cgr and plot it using matplotlib.
56
"""
67

78
import matplotlib.pyplot as plt

doc/source/examples/Ni_refinement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
43
"""Perform simple refinement of Ni structure to the experimental x-ray PDF.
4+
55
Save fitted curve, refined structure and results summary.
66
"""
77

news/pcmt.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* no news: precommit and style check
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
22

33
# Extensions script for diffpy.pdffit2
4-
54
"""PDFfit2 - real space structure refinement engine
65
76
Packages: diffpy.pdffit2

src/diffpy/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# See LICENSE.rst for license information.
1515
#
1616
##############################################################################
17-
1817
"""diffpy - tools for structure analysis by diffraction.
1918
2019
Blank namespace package for module diffpy."""

src/diffpy/pdffit2/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# See LICENSE.rst for license information.
1515
#
1616
##############################################################################
17-
1817
"""PDFfit2 - real space structure refinement program."""
1918

2019
# WARNING: Do NOT remove the isort: off/on comments in this file.

src/diffpy/pdffit2/ipy_ext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22

3-
"""This module defines functions within IPython session to simulate
4-
the old pdffit2 interactive session.
3+
"""This module defines functions within IPython session to simulate the old
4+
pdffit2 interactive session.
55
66
Usage: %load_ext diffpy.pdffit2.ipy_ext
77
"""

src/diffpy/pdffit2/output.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See LICENSE.txt for license information.
1313
#
1414
##############################################################################
15-
1615
"""Take care of sending engine output to given file-like object.
16+
1717
The output file is stored in local module variable stdout.
1818
"""
1919

@@ -28,6 +28,7 @@
2828

2929
def redirect_stdout(dst):
3030
"""Redirect PDFfit2 standard output to a file-like object dst.
31+
3132
The dst value is stored in module variable stdout.
3233
"""
3334
from diffpy.pdffit2.pdffit2 import redirect_stdout

0 commit comments

Comments
 (0)