In the middle of the desert you can say anything you want
TIL1:
./git/info/exclude
is your local .gitignore
outside the repository tree!git update-index --assume-unchanged .gitignore
makes git stop checking the changes for that file in the working tree. --no-assume-unchanged
to take it back.23Finally a place for my local ignores that won’t appear in autocomplete suggestions for git add
and friends. In Pycharm I have changelists, and now I finally have a solution for my just-as-usual vim/git/CLI workflow as well.
BUT:
exclude
won’t work if the file is already tracked (says SO but for me it works?..)As of 2024-10-02 20:16 at least.
give me the ag command to look inside markdown and yaml files only
GPT4o1:
`ag --include='*.md' --include='*.yaml' --include='*.yml' 'search_pattern'`
GPT42:
`ag "search_pattern" --markdown --yaml`
github/git-sizer: Compute various size metrics for a Git repository, flagging those that might cause problems (linked by Repository limitations and recommendations)
TL;DR too many files? too large one? too many tags? Find out!
yay
took forever to compress pycharm. Like, 5-10 mins at least.
TODO documentation, but if you don’t care about package size but care about speed, this will speed up everything considerably:
PKGEXT='.pkg.tar' yay -S pycharm-professional
Wanted to do sth like this all the time, but the help basically told me to copypaste multiple arguments etc.
Will come back to bite me but nice to have the option I guess
Question: How can I install packages without having to confirm? · Issue #1033 · Jguer/yay:
echo y | LANG=C yay --noprovides --answerdiff None --answerclean None --mflags "--noconfirm" $PKGNAME
(--noconfirm
is not documented in help and man, and of course can create problems1)
BUT ALSO
yes
is a command that exists.
Then:
yes | yay ...
or yes | LANG=C yay
And generally really neat to have a command for answering “yes” to prompts.
And then quick unsafe bad dangerous command to update everything that includes 241001-1512 Yay better compression algos:
echo y | LANG=C PKGEXT='.pkg.tar' yay --answerdiff None --answerclean None --mflags "--noconfirm"
So Slicer seems to use both and I need to as well, so I’ll have to learn that sooner or later.
open-source, cross-platform library that provides developers with an extensive suite of software tools for image analysis (About | ITK)
there’s a python package docu:
In pycharm, updated black to use these args:
--preview --enable-unstable-feature string_processing $FilePath$
The (future of the) Black code style - Black 24.8.0 documentation has both the preview style and the unstable features one can enable (by passing the flag multilple times).
string_processing
breaks long strings into multiple shorter ones, one on each line.
Useful:
mypy cares about packages, especially __init__.py
files — the uppermost dir with such a file will be the root package. See Mapping files to modules - Running mypy and managing imports - mypy 1.12.0+dev.ecfab6a02415c46eda5717ec6ee9bfac8115c1e9.dirty documentation
This is needed to do per-package configs
[mypy-mycode.package.etc]
disable_error_code = attr-defined, union-attr
Problem: the pycharm extension I have crashes in the last version. :(
Main and best: python - How to run Pylint with PyCharm - Stack Overflow
My changes:
--msg-template="{abspath}:{line:5d},{column:2d}: {C}/{msg} ({symbol})" --output-format=colorized "$FilePath$"
"
, otherwise it failed for me, and {C}
— for the message class see man page (or below) for list of format string options.$FILE_PATH$:\s*$LINE$\,\s*$COLUMN$
I had two options as separate tools:
$FileParentDir$
at the end.--recursive=y
— fails on no __init__.py
otherwiseWorked neatly with a .pylintrc
file in repo root with e.g.
[tool.pylint.main]
[tool.pylint.basic]
# "too-few-public-methods", disable
min-public-methods=0
function-naming-style="camelCase"
argument-naming-style="camelCase"
method-naming-style="camelCase"
variable-naming-style="camelCase"
attr-naming-style="camelCase"
[tool.pylint."messages control"]
disable = [
"fixme", # TODOs
"import-error", # runner has them in its environment
"import-outside-toplevel", # explicit requirement of XXX to import where used
"duplicate-code" # entangling different extensions/modules is not the solution
]
Pylint format string options from man pylint
:
path relative path to the file
abspath
absolute path to the file
line line number
column column number
end_line
line number of the end of the node
end_column
column number of the end of the node
module module name
obj object within the module (if any)
msg text of the message
msg_id the message code (eg. I0011)
symbol symbolic name of the message (eg. locally-disabled)
C one letter indication of the message category
category
fullname of the message category
For example, the former (pre 1.0) default format can be obtained with:
pylint --msg-template='{msg_id}:{line:3d},{column}: {obj}: {msg}'
If I have this post open, I’ll need this one anyway: Messages control - Pylint 4.0.0-dev0 documentation