普通视图

发现新文章,点击刷新页面。
昨天 — 2026年4月17日jdhao's blog
昨天以前jdhao's blog

Pre-commit Setup for Your Project

2026年4月15日 00:11

We have a Python project where there are several developers, and we have a mature CI pipeline to do code linting, formatting check for python, yaml, json, and testing etc. The problem with CI pipeline is that you can only get feedback after you commit your code and push to the remote repo. The feedback is not instant and may be delayed for several minutes. If there are some linting issues, you then need to fix the issue and make another commit. This is also making the PR history messy.

I read the nvim v0.12 release note so you don't have to

2026年4月3日 05:18

A major Neovim release (version 0.12) has been released a few days ago, after more than one year from the last major release (version 0.11). The following is a list of feature I am interested. For a complete set of features, check full changelog and news.

builtin package manager vim.pack
#

Now you can use the builtin vim.pack API to manage your plugins. Check this detailed post if you want to migrate to vim.pack.

Migrate Python Project from Pip to Uv

2026年3月28日 02:12

Previously, our projects are still using the old Python 3.10, which will be deprecated soon this year. We are also using the good old pip and venv for the project/package management. This is already posing some issues for us:

  • venv is a pure virtual env tool without the ability to manage python versions (it just picks your local python), so it is hard to enforce the local env of each developer
  • pip’s requirements.txt is not a lockfile and thus does not ensure a fully reproducible python environment
  • pip as a package management tool is not performant enough in resolving and installing packages

In order to solve these problems, I took the effort to migrate our project management to uv. Here are some of the things that I learned in the process as a first-time uv user.

Check Trailing White Spaces in Your Project

2025年12月20日 01:19

When I am working on a Python project, I am using black to format the code, so that we have a unified format across the code base.

One pain point, however, is the super annoying trailing white spaces:

  1. black can remove trailing spaces for doc string, code and comment, but it will not touch trailing spaces in, e.g., multi-line strings.

Python system PATH issues When We Use Pytest

2025年5月14日 00:28

When I try to run pytest locally for a Python project, I noticed that the import in those test scripts may fail if I run pytest in different directories. The import error usually means that your actual code modules is not in the python path, so they can not be imported successfully by your test scripts.

This has something to do with how pytest set up the python path when you run it.

❌
❌