0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Python】静的コード解析ツール、Flake8

Posted at

Flake8

 Flake8はコーディング規約であるPEP8に準拠しているか、不具合のもとになる箇所がないかを中心に静的コード解析を行う。
 Flake8は3つの静的コード解析ツールを1つにまとめたツールである。Flake8を実行すると、これら3つのツールの観点でソースコードに対しチェックを行う。

Flake8に含まれている静的コード解析ツール

pycodestyle

 PEP8に準拠しているかチェックする
https://pycodestyle.pycqa.org/

Pyflakes

 不具合のもとになりそうな箇所はないかチェックする
https://github.com/pycqa/pyflake

McCabe

 コードの複雑さをチェックする
https://github.com/pycqa/mccabe

なぜFlake8で静的コード解析するのか

 Flake8を利用することで、PEP8の準拠だけでなくコードの不備、複雑度もチェックできる。検出された問題点を解決することでバグの発生を未然に防ぎ、読みやすいコードになる。

参考文献

Pythonエンジニア育成推進協会監修 Python実践レシピ 単行本(ソフトカバー) – 2022/1/19
鈴木 たかのり (著), 筒井 隆次 (著), 寺田 学 (著), 杉田 雅子 (著), 門脇 諭 (著), 福田 隼也 (著)
p.25-27

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?