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
16
0
Share
R.*u.*f.*f.*
Ruff に「ろしでれ」要素を追加した
taxfree
September 21, 2024
More Decks by taxfree
See All by taxfree
研究開発のための Coding Agent 活用術
taxfree_python
0
65
R&D_UIのラストワンマイルをLLMで埋める
taxfree_python
0
15
AI for タギロン
taxfree_python
0
37
traP 2024 忘年会
taxfree_python
0
10
traP ユニークビジョン LT 会
taxfree_python
0
16
traP_新入生オリエンテーション_2024
taxfree_python
0
110
A Beginner's Guide to Quantum computing
taxfree_python
0
420
How to create slack Bot with Python?
taxfree_python
1
350
create tweet Word-cloud with python
taxfree_python
1
360
Featured
See All Featured
Claude Code のすすめ
schroneko
67
220k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
120
SEO for Brand Visibility & Recognition
aleyda
0
4.5k
So, you think you're a good person
axbom
PRO
2
2k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
400
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.4k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.6k
Building Adaptive Systems
keathley
44
3k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Docker and Python
trallard
47
3.8k
Test your architecture with Archunit
thirion
1
2.2k
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