- C 90%
- Perl 3.6%
- Raku 1.9%
- Awk 1.6%
- Shell 1.1%
- Other 1.8%
|
Tobias Kortkamp
c210fc32e2
ast/writer.c:425:12: error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare] 425 | h->end = MIN(h->end + context, p->sessz - 1); | ^ ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~ /usr/include/sys/param.h:331:23: note: expanded from macro 'MIN' 331 | #define MIN(a,b) (((a)<(b))?(a):(b)) | ~ ^ ~ |
||
|---|---|---|
| ast | Unbreak on FreeBSD 14.2 with clang 18 | |
| edit | *: Use nullptr | |
| libias | libias/str: Add titlecase() and titlecase_p() | |
| lint | *: Use nullptr | |
| man/man1 | main: Gc apply command | |
| portscan | *: Use nullptr | |
| scripts | *: Use nullptr | |
| tests | libias/str: Add titlecase() and titlecase_p() | |
| .clangd | Chase libias: mkbuild: Avoid hidden directories | |
| .dir-locals.el | build: Use gnu23 | |
| .editorconfig | Add non-default option to use mimalloc | |
| .envrc | ast/word: Implement word eval and eval of some expand modifiers | |
| .gitignore | .gitignore: Ignore /_build entirely | |
| ast.c | ast: Parse .break | |
| ast.h | ast: Parse .break | |
| build.ninja | build: switch to ninja | |
| build.ninja.spec | build: Use gnu23 | |
| buildinfo.h | Update license headers | |
| CHANGELOG.md | Release 1.1.6 | |
| configure | build: if BUILDDIR is a symlink resolve it first | |
| constants.c | Update constants | |
| constants.h | rules: Unroll VAR_FOR_EACH_* at runtime | |
| diagnostic.c | *: Use nullptr | |
| diagnostic.h | main: add argument parser and other diagnostics | |
| guix.scm | Start enabling UTF-8 support | |
| LICENSE | Update license headers | |
| lint.h | lint/order: Start work to decouple from Parser class | |
| main.c | *: Use nullptr | |
| main.h | main: Add --show-range option to ast command | |
| mainutils.c | *: Use nullptr | |
| mainutils.h | Convert to UTF-8 aware string type | |
| mkbuild.c | build: Use gnu23 | |
| options.spec | main: Add --show-range option to ast command | |
| portscan.c | *: Use nullptr | |
| range.c | *: Use nullptr | |
| range.h | main: Add --show-range option to ast command | |
| README.md | Replace references to GitHub | |
| regexp.c | *: Use nullptr | |
| regexp.h | regexp: Remove improper returns_nonnull attribute | |
| rules.c | *: Use nullptr | |
| rules.h | rules: Add USES=ocaml block | |
| sandbox.c | *: Use nullptr | |
| sandbox.h | main: add sandbox module | |
| sexp.c | *: Use nullptr | |
| sexp.h | sexp: Add generic (over buffer and file) render function | |
portfmt
Portfmt is a collection of tools for editing, formatting, and linting FreeBSD Ports Collection Makefiles.
It comes with several tools:
portfmtformats Makefilesportclippyis a linter that checks if variables are in the correct order in a more comprehensive way thanportlintporteditedits Makefiles. It comes with several commands that can be used as a basis for your own port update scripts:bump-epoch: bumpsPORTEPOCHor inserts it at the right placebump-revision: bumpsPORTREVISIONor inserts it at the right placeset-version: resetsPORTREVISION, setsDISTVERSIONorPORTVERSIONget: lookup unevaluated variable valuesmerge: Generic command to set/update variables while also formatting the updated variables properly and inserting them in the right places if necessary. Useful for merging output of other tools like make cargo-crates, modules2tuple, or make stage-qa. For example to mark a port deprecated:
printf "DEPRECATED=%s\nEXPIRATION_DATE=%s" \
Abandonware 2019年08月15日 | portedit merge -i Makefile
portscanchecks the entire Ports Collection for mistakes like unreferenced variables, etc.
Example
A Makefile like this
LICENSE_PERMS= dist-mirror pkg-mirror auto-accept dist-sell pkg-sell
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}paho-mqtt>=0:net/py-paho-mqtt@${PY_FLAVOR}
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}supervisor>=0:sysutils/py-supervisor@${PY_FLAVOR}
USES= cmake \
compiler:c++11-lib \
desktop-file-utils \
gettext-tools \
pkgconfig \
qt:5 \
sqlite \
gl
USE_QT= buildtools_build \
concurrent \
core \
dbus \
gui \
imageformats \
linguist_build \
network \
opengl \
qmake_build \
testlib_build \
sql \
widgets \
x11extras \
xml
FOOBAR_CXXFLAGS= -DBLA=foo # workaround for https://github.com/... with a very long explanation
is turned into
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}paho-mqtt>=0:net/py-paho-mqtt@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}supervisor>=0:sysutils/py-supervisor@${PY_FLAVOR}
USES= cmake compiler:c++11-lib desktop-file-utils gettext-tools gl \
pkgconfig qt:5 sqlite
USE_QT= concurrent core dbus gui imageformats network opengl sql widgets \
x11extras xml buildtools_build linguist_build qmake_build \
testlib_build
# workaround for https://github.com/... with a very long explanation
FOOBAR_CXXFLAGS= -DBLA=foo
Building portfmt
If you want to build portfmt from the repository make sure to also clone the submodules: git clone --recurse-submodules https://codeberg.org/tobik/portfmt
Building portfmt requires Ninja (packaged often as ninja or ninja-build) or Samurai (package samurai).
- Prepare the build:
./configure PREFIX=/usr/local - Build it:
ninja - The binaries are available under
_build/.bin/and can be run directly or optionally installed with:ninja install
Editor integration
You can integrate Portfmt into your editor to conveniently run it
only on parts of the port, e.g., to reformat USES after adding a
new item to it.
Emacs
Add this to ~/.emacs.d/init.el to format the current region with
C-c p.
(defun portfmt (&optional b e)
"PORTFMT(1) on region"
(interactive "r")
(shell-command-on-region b e "portfmt " (current-buffer) t
"*portfmt errors*" t))
(with-eval-after-load 'make-mode
(define-key makefile-bsdmake-mode-map (kbd "C-c p") 'portfmt))
Kakoune
Add this to ~/.config/kak/kakrc for filtering the current selection
through portfmt with ,1:
map global user 1 '|portfmt<ret>;' -docstring "portfmt on selection"
Vim
Add this to ~/.vimrc for filtering the current selection through
portfmt with 1円:
xnoremap <leader>1 <esc>:'<,'>!portfmt<CR>