From bad6737e280359fbd99def7487c574f434c07a34 Mon Sep 17 00:00:00 2001 From: Kappibw Date: Thu, 7 Mar 2024 21:58:11 +0100 Subject: [PATCH] Add bonus tip to README.md --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index f7488d3..a9199db 100644 --- a/README.md +++ b/README.md @@ -185,3 +185,25 @@ This may include: - Measuring the time ## Other usefull tasks [Bonus Points] + +#### Settings.json +Instead of running +```shell +black --line-length 120 ~/git/plr-exercise +``` +each time you want to reformat, you can instead open your vscode user settings: + +`ctrl+shit+p` -> "Open User Settings (JSON)" + +_Note:_ if you want this to apply only to your current project (not all your vscode projects), open workspace settings instead. + +and edit it to add python options that format automatically every time you save: +``` + "[python]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "ms-python.black-formatter", + }, + "black-formatter.args": [ + "--line-length=120" // Or anything you prefer. + ], +```