Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Fix pylinting single file #136

Closed
wants to merge 3 commits into from

Conversation

leohemsted
Copy link

as pointed out here, opening a single file leads to problems as projDir is set to [...]/dir/my_file.py instead of [...]/dir.

i'm barely familiar with atom packages or coffeescript so let me know if there's any better way to solved this

also it works on windows (64bit) - will test on ubuntu in a bit, don't have an OSX install to hand to test on that.


This change is Reviewable

@leohemsted leohemsted changed the title test Fix pylinting single file Apr 4, 2016
@Arcanemagus
Copy link
Member

Travis is testing on OS X btw 😉.

@@ -105,7 +105,8 @@ module.exports =
lintIssue

getProjDir: (filePath) ->
atom.project.relativizePath(filePath)[0]
projDir = atom.project.relativizePath(filePath)[0]
if projDir is filePath then path.parse(filePath).dir else projDir
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be clearer to replace the path.parse(filePath).dir with path.dirname(filePath)?

@leohemsted
Copy link
Author

@Arcanemagus updated use of dirname - i realise travis' testing on OS X but a brief look at the test appears that we're not, at least, trying out loading a project folder vs file - so i'd like it if someone could either gimme a hand/some pointers writing a relevant test (I've never done anything with the atom package api), or just fire it up on OSX and make sure i haven't somehow broken everything. I'm not ruling anything out when it comes to platform independency 😭

@Arcanemagus
Copy link
Member

I'm going to mark this as closed for a few reasons:

  • The codebase is now ES6, so this would need to be redone in the first place
  • The ability to open a file in that broken matter is an Atom bug, I don't think putting a workaround in here for that is the best of ideas
  • I can't reproduce the bug anyway 😛

If you can reproduce it on Atom v1.9.0-beta0 can you contact me on Atom's Slack to debug it further?

@Arcanemagus Arcanemagus closed this Jun 7, 2016
@leohemsted leohemsted deleted the single_file_err branch June 8, 2016 23:41
@leohemsted
Copy link
Author

Just checked on 1.9.0-beta0, can't reproduce as can't open the file in the same previous way (it now automatically opens the parent dir when you open file), so happy with this being closed 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants