Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proselint doesn't work on readonly files #502

Closed
viccuad opened this issue Jun 29, 2016 · 4 comments
Closed

Proselint doesn't work on readonly files #502

viccuad opened this issue Jun 29, 2016 · 4 comments

Comments

@viccuad
Copy link
Contributor

viccuad commented Jun 29, 2016

On command_line.py:192

            f = click.open_file(fp, 'r+', encoding="utf-8")

We are opening files to be linted with 'r+', which opens the file for both reading and writing (instead of 'r' which opens as read only).

This may not be needed, and breaks proselint for some files such as demo.md (therefore it breaks proselint --demo) when installed with a distribution package manager.

I've discovered this because of the Debian proselint package I mantain has that demo.md, and I have resorted on patching it temporarily to make it open files as readonly. Please, notify me if proselint intends to modify files in the future, and we need to find another solution.

@suchow
Copy link
Member

suchow commented Jul 1, 2016

Thanks. We don't intend for Proselint to modify files. At some point, perhaps, it would interesting to create an autoproselint linter in analogy to autopep8, but that's a different project. I'll make this change now.

@suchow
Copy link
Member

suchow commented Jul 1, 2016

Hm. What version of Proselint are you looking at? On master, the line you specified already uses r:

https://github.com/amperser/proselint/blob/master/proselint/command_line.py#L115

It seems this improvement was made by @Tatsh in commit a52c908.

@viccuad
Copy link
Contributor Author

viccuad commented Jul 1, 2016

I found it on 0.5.3, the version that is currently being shipped in Debian.

I will happily drop the patch for the next shipped version :)

Seems like we can consider this fixed, let me close the issue.
Thanks and cheers.

@viccuad viccuad closed this as completed Jul 1, 2016
@suchow
Copy link
Member

suchow commented Jul 1, 2016

@viccuad I've released Proselint 0.6.0, which includes this change.

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

No branches or pull requests

2 participants