Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.

Prettifier runs in file's directory #101

Merged
merged 2 commits into from
Sep 16, 2015

Conversation

zlondrej
Copy link
Contributor

This change is primarily for stylish-haskell, which searches
for .stylish-haskell.yaml configuration file from current working
directory up to the root. This makes possible to have better controll
of haskell source formatting.

This change is primarily for stylish-haskell, which searches
for `.stylish-haskell.yaml` configuration file from current working
directory up to the root. This makes possible to have better controll
of haskell source formatting.
@lierdakil
Copy link
Contributor

Problem is, getPath() doesn't necessarily return a meaningful path (or any path at all). In particular, if you haven't saved buffer yet, this code will break. So there has to be a fallback of some sort. I don't have too much time on my hands, so if you could, that'd be great.

@zlondrej
Copy link
Contributor Author

Actually it won't break with unsaved buffer. Calling dirname with null or undefined returns . path.
And I can not think of another problem than getPath returning undefined.

Anyway I can put some fallback just in case if you want, but I don't think it's necessary.

@lierdakil
Copy link
Contributor

Huh. It does. My bad. There have been fringe cases where Atom got me something weird, like atom:// uri, though, so here's an idea: check if what you've got is actually a directory, and fallback to . if that isn't the case. That would probably be robust enough.

@zlondrej
Copy link
Contributor Author

Done.

@zlondrej zlondrej closed this Sep 15, 2015
@zlondrej zlondrej reopened this Sep 15, 2015
@lierdakil
Copy link
Contributor

Great, thanks. I'll try to merge/publish by tomorrow (meaning - expect a
release in next 24 hrs)
15 сент. 2015 г. 16:06 пользователь "Ondřej Janošík" <
[email protected]> написал:

Reopened #101 #101.


Reply to this email directly or view it on GitHub
#101 (comment).

lierdakil added a commit that referenced this pull request Sep 16, 2015
Run prettifier in file directory
@lierdakil lierdakil merged commit 77b05c0 into atom-haskell:master Sep 16, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants