Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
R.*u.*f.*f.*
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
taxfree
September 21, 2024
0
14
R.*u.*f.*f.*
Ruff に「ろしでれ」要素を追加した
taxfree
September 21, 2024
Tweet
Share
More Decks by taxfree
See All by taxfree
AI for タギロン
taxfree_python
0
36
traP 2024 忘年会
taxfree_python
0
9
traP ユニークビジョン LT 会
taxfree_python
0
12
traP_新入生オリエンテーション_2024
taxfree_python
0
100
A Beginner's Guide to Quantum computing
taxfree_python
0
400
How to create slack Bot with Python?
taxfree_python
1
340
create tweet Word-cloud with python
taxfree_python
1
360
I went to PyCon APAC 2019
taxfree_python
0
30
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
350
Thoughts on Productivity
jonyablonski
74
5k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
The Pragmatic Product Professional
lauravandoore
37
7.1k
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Site-Speed That Sticks
csswizardry
13
1.1k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
98
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Transcript
R.*u.*f.*f.* 東京工業大学 tax_free 2024/09/21 @PFN cafe
1. 自己紹介 所属: 東京工業大学 情報理工学院 数理・計算科学系 専門: 数理最適化(研究室は連続をやってる人が多い) サークル: iGEM
を 2 年やってた traP で自炊した写真を共有するなど 趣味: ご飯を食べるのと作るのが好き (回数は少ないけど)旅行するのが好き Twitter: @taxfree_python
2. Ruff とは Python の linter かつ code formatter 嬉しさ
1 嬉しさ 2 いろんなツールがまとまってる Rust で書かれているので早い Flake8 (linter) + Black (formatter) + isort (import sorting) + pydocstyle (docstring formatter) ↓ Ruff 実行時間(sec) 0 10 20 30 40 50 60 Ruff Autoflake Flake8 Pyflakes Pycodestyle Pylint 実行時間のデータは https://docs.astral.sh/ruff/ より
3. 構文解析器の仕組みを(やんわり)説明 構文解析(こうぶんかいせき、英語: parsing, syntactic analysis, syntactic analysis) は、ある言語において、その形式文法に従って記号の文字列を分析する手続きである。 構文解析を行う機構を構文解析器(parser)と呼ぶ。
(https://ja.wikipedia.org/wiki/構文解析 より引用) 構文解析とは: Python だと ast ライブラリを使うと簡単に試すことができる! サンプルコードは https://docs.python.org/ja/3/library/ast.html より引用
4. 時々ボソッとロシア語でデレる隣のアーリャさんの紹介 重要な注意: 私は読んでいません 私が知っている情報: ヒロイン?がロシア語を話すらしい ヒロイン?の声優がロシア語専攻だった ロシア語のタイトルがある Иногда́ А́ля
внеза́пно коке́тничает по-ру́сски 時々 アーリャは (主) 急に いちゃつく (現在形) coquet(英) ロシア語で
5. Ruff + 時々ボソッとロシア語でデレる隣のアーリャさん = ??? 左の Ruff のロゴは https://docs.astral.sh/ruff/
より引用 右のろしでれのロゴは https://roshidere.com/ より引用
5. Ruff + 時々ボソッとロシア語でデレる隣のアーリャさん = ??? Ruff = R(ussian) u(neven)
f(lirtatious) f(ormatter)
6. R(ussian) u(neven) f(lirtatious) f(ormatter) の機能 機能 1 機能 2
ロシア語でツンデレな?フィードバッ クをしてくれる check 中にかわいいアスキーアートが 表示される у вот, опять нужно проверять этот файл... хотя, может, он не такой уж плохой. Просто ужасно (原作)
7. 実際に動かしてみる
8. 実行速度 実行時間(sec) 0.00 0.02 0.04 0.06 0.08 0.10 Ruff(pure)
Ruff 実行時間(sec) 0.00 0.02 0.04 0.06 0.08 0.10 Ruff(pure) Ruff benchmark_data/1.py を 100 実行して 平均の実行時間を計算 benchmark_data/2.py を 100 実行して 平均の実行時間を計算
9. 今後の開発計画 terminal のサイズが小さいときでも表示できるようにする PyPI に publish する もっと多様な反応を実装したい 違反の種類ごとにメッセージを変える
E1 ← pycodestyle のインデントに関する怒られ F ← pyflakes に関する怒られ LLM を挟んでそれっぽい文をリアルタイムで生成する 違反してる部分を組み込んだメッセージが出せると嬉しいかも Rust で書けると嬉しい... lint + format だけじゃなくて,ろしでれ Копилот の誕生も近い? repository