Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ufmt is a safe, atomic code formatter for Python built on top of black and usort: - Black makes code review faster by producing the smallest diffs possible. Blackened code looks the same regardless of the project you're reading. - usort is a safe, minimal import sorter. Its primary goal is to make no "dangerous" changes to code, and to make no changes on code style. ufmt formats files in-memory, first with usort and then with black, before writing any changes back to disk. This enables a combined, atomic step in CI/CD workflows for checking or formatting files, without any chance of conflict or intermediate changes between the import sorter and the code formatter.
- Loading branch information
Showing
4 changed files
with
45 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
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,30 @@ | ||
PORTNAME= ufmt | ||
PORTVERSION= 2.5.1 | ||
CATEGORIES= devel python | ||
MASTER_SITES= PYPI | ||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} | ||
|
||
MAINTAINER= sunpoet@FreeBSD.org | ||
COMMENT= Safe, atomic formatting with black and usort | ||
WWW= https://ufmt.omnilib.dev/en/stable/ \ | ||
https://github.com/omnilib/ufmt | ||
|
||
LICENSE= MIT | ||
LICENSE_FILE= ${WRKSRC}/LICENSE | ||
|
||
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}flit-core>=3.8<4:devel/py-flit-core@${PY_FLAVOR} | ||
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}black>=20.8b0:devel/py-black@${PY_FLAVOR} \ | ||
${PYTHON_PKGNAMEPREFIX}click>=8.0:devel/py-click@${PY_FLAVOR} \ | ||
${PYTHON_PKGNAMEPREFIX}libcst>=0.4.0:devel/py-libcst@${PY_FLAVOR} \ | ||
${PYTHON_PKGNAMEPREFIX}moreorless>=0.4.0:devel/py-moreorless@${PY_FLAVOR} \ | ||
${PYTHON_PKGNAMEPREFIX}tomlkit>=0.7.2:textproc/py-tomlkit@${PY_FLAVOR} \ | ||
${PYTHON_PKGNAMEPREFIX}trailrunner>=1.2.1:devel/py-trailrunner@${PY_FLAVOR} \ | ||
${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.0:devel/py-typing-extensions@${PY_FLAVOR} \ | ||
${PYTHON_PKGNAMEPREFIX}usort>=1.0:devel/py-usort@${PY_FLAVOR} | ||
|
||
USES= python | ||
USE_PYTHON= autoplist concurrent pep517 | ||
|
||
NO_ARCH= yes | ||
|
||
.include <bsd.port.mk> |
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,3 @@ | ||
TIMESTAMP = 1712330561 | ||
SHA256 (ufmt-2.5.1.tar.gz) = af53400cbc0498d5d57f79bdf8c0e13df67f384ab38ab9881b15e4ceb04c5d64 | ||
SIZE (ufmt-2.5.1.tar.gz) = 75447 |
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,11 @@ | ||
ufmt is a safe, atomic code formatter for Python built on top of black and | ||
usort: | ||
- Black makes code review faster by producing the smallest diffs possible. | ||
Blackened code looks the same regardless of the project you're reading. | ||
- usort is a safe, minimal import sorter. Its primary goal is to make no | ||
"dangerous" changes to code, and to make no changes on code style. | ||
|
||
ufmt formats files in-memory, first with usort and then with black, before | ||
writing any changes back to disk. This enables a combined, atomic step in CI/CD | ||
workflows for checking or formatting files, without any chance of conflict or | ||
intermediate changes between the import sorter and the code formatter. |