#author("2024-03-05T16:21:46+09:00","","") #topicpath //////////////////////////////////////////////////////////////////////////////// * 目次 [#b4ee840e] #contents(); //////////////////////////////////////////////////////////////////////////////// * 開発環境 [#ge17897e] //============================================================================== ** pylint [#pylint] - python 用の lint - python で書かれたコードを入力すると、そのコードの文法上の問題点を指摘する。 - 警告の意味が分からない場合は、[[Pylint 3.1.0-dev0 documentation>https://pylint.readthedocs.io/en/latest/index.html]] でキーワード検索することで、問題コード例と修正例を閲覧することが出来る。これを参考に指摘箇所を修正することが出来る。 //============================================================================== ** mypy [#s60e75da] //============================================================================== ** flake8 [#e0883e53] //============================================================================== ** autopep8 [#autopep8] - python のコーディングルール "PEP8" に準拠していない箇所を指摘したり、修正したりする。 - PEP8 のドキュメント(日本語訳): [[pep8-ja>https://pep8-ja.readthedocs.io/ja/latest/]] //============================================================================== ** isort [#isort] - python 標準の import 順に準拠していない箇所を指摘したり、修正したりする。 //============================================================================== ** debian env [#p6456239] - emacs - elpa-flycheck - pylint - flake8 - isort - elpa-py-isort - mypy //============================================================================== ** configure [#u72597d8] - flycheck (require 'flycheck) ;; checking error by compiler (flycheck-define-checker c/c++ "A C/C++ checker using clang++." :command ("clang" "-Wall" "-Wextra -std=c++20" source) :error-patterns ((error line-start (file-name) ":" line ":" column ":" " Error: " (message) line-end) (warning line-start (file-name) ":" line ":" column ":" " Warning: " (message) line-end)) :modes (c-mode c++-mode)) ;; エラーをツールチップ表示する ; (with-eval-after-load 'flycheck ; (flycheck-pos-tip-mode)) - isort (when (executable-find "isort") ; システム上に isort があるときだけ (require 'py-isort) ;; 保存時にバッファ全体を自動整形する (add-hook 'before-save-hook 'py-isort-before-save) ) //////////////////////////////////////////////////////////////////////////////// * links [#ye6be695] - [[Pythonのリンター・フォーマッターをしっかりと理解する(Flake8, Black, isort, mypy)>https://zenn.dev/tanny/articles/cdb555d6124a2a]]