You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me there is no rule to warn about "problematic code" like this:
Path('~/.ssh/id_rsa')
The IMHO better solution would be the following, because there is no platform depended path separator used.
Path.home() / '.ssh' / 'id_rs'
I am aware that the first example is technically no problem and pathlib can handle that and convert it on Windows platforms. But to my stomach it is bad habit.
So I wonder why you don't have a rule about that to track that down? I might be totally wrong or to pedantic about it? ;)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
X-Post: https://gitlab.com/RoPP/flake8-use-pathlib/-/issues/10
Hello,
I am interested in your opinion here.
It seems to me there is no rule to warn about "problematic code" like this:
The IMHO better solution would be the following, because there is no platform depended path separator used.
I am aware that the first example is technically no problem and pathlib can handle that and convert it on Windows platforms. But to my stomach it is bad habit.
So I wonder why you don't have a rule about that to track that down? I might be totally wrong or to pedantic about it? ;)
Best,
Christian
Beta Was this translation helpful? Give feedback.
All reactions