git attributes

关于 git attributes 的误解说明

gitattributes 的作用:

  1. 在提交 commit 时,把本地的 换行符替换成和 已有 commit 中一致
  2. git clone 时,换成和本机兼容的换行符

gitattributes 没有的功能:

  1. 把已有 commit 中文件的换行符替换成新规定的换行符

pyproject file

模板

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
[tool.pylsp-mypy]
enabled = true
live_mode = false
dmypy = true                    # enable dmypy
strict = true


[tool.pdm.dev-dependencies]
lsp = [
    "python-lsp-server>=1.8.0",
    "python-lsp-ruff>=1.5.1",
    "python-lsp-black>=1.3.0",
    "pylsp-mypy>=0.6.7",
    "pylsp-rope>=0.1.11",
]

[tool.ruff]
ignore = ["E501"]               # ignore line length
line-length = 100

pylsp + pdm

pdm add -dG lsp python-lsp-server python-lsp-ruff python-lsp-black pylsp-mypy pylsp-rope