atom / teletype

Share your workspace with team members and collaborate on code in real time in Atom
https://teletype.atom.io
MIT License
2.41k stars 324 forks source link

linting packages broken during teletype sharing (python-linter-flake8) #228

Open simkimsia opened 6 years ago

simkimsia commented 6 years ago

Prerequisites

Description

User Alice is using teletype to share her screen with User Bob.

Both Alice and Bob installed python-flake8

On Bob's machine, everytime there is a change in the screen, the flake8 throws an error about cannot find /usr/local/bin/flake8 and making sure it's installed in path.

To resolve this, Bob needs to disable his flake8.

Bob now shares his screen with Alice. Now the error message appears on Alice's screen.

The disable solution also works

Steps to Reproduce

See above

Expected behavior:

No flake8 error on the users' screen

Actual behavior:

Flake8 error on the users' screen

Reproduces how often:

Every single time the flake8 is enabled and when it's on the people joining the share.

Versions

Mac OSX 10.13.1 for both Alice and Bob

Atom v1.22.1 for both Alice and Bob

Additional Information

Please include any additional information, configuration or data that might be necessary to reproduce the issue. Screenshots, if appropriate, are helpful as well.

nathansobo commented 6 years ago

The problem with most linters is that they depend on the contents of the files being on disk, which in the current implementation they are not. We do plan to do full file system replication in the future, which should make this case a lot easier.

szhu commented 6 years ago

Is there a setting to disable the linters in teletype windows?

I'm using linter and linter-rubocop and I'm getting:

[Linter] Error running RuboCop Error: Failed to spawn command `rubocop`. Make sure `rubocop` is installed and on your PATH
Arcanemagus commented 6 years ago

@szhu That message has nothing to do with teletype. You haven't configured linter-rubocop properly since it doesn't seem to know where rubocop is on your system.

All that being said, you can run Linter: Toggle Active Editor from the Command Palette to temporarily disable all linting on the active (shared/teletype) TextEditor.

Arcanemagus commented 6 years ago

Maybe this is a deeper issue than a misconfiguration of the remote side, since in #228 @newQuery stated that switching sides made it work again.

I'm guessing that this is a combination of providers not properly checking the file path, and/or generating an invalid command from whatever path they are getting (that then breaks execution of the external linter program).

Arcanemagus commented 6 years ago

Okay, so it looks like TextEditor::getPath is returning a path like: @user:project-root-folder/path/in/project/foo.ext

Since all of the providers currently only check whether the path exists or not, they think this path is a valid one and assume that linting is possible.

Since the @ symbol is breaking command generation on multiple platforms, I'm thinking that in linter and atom-ide-ui linting should just be blocked for these editors, at least until full file replication is being done. Is it a valid assumption that textEditor.getPath().startsWith('@') will capture all portal editors?

jasonrudolph commented 6 years ago

Is it a valid assumption that textEditor.getPath().startsWith('@') will capture all portal editors?

@Arcanemagus: That assumption is valid today, but it might be more intention-revealing to check for the existence of the isRemote property that teletype adds to remote TextEditor objects:

https://github.com/atom/teletype/blob/63423828bbf5170468967f06761cd305274ab336/lib/editor-binding.js#L82

What do you think?

Arcanemagus commented 6 years ago

I think that would work just as well as the path checking for now.

The bigger question is where to apply the filtering: the "manager" like linter or atom-ide-diagnostics, or in the provider's themselves. That's not a question that is relevant to this project though 😛.

Thanks for the pointer to isRemote!

rsese commented 6 years ago

I think https://github.com/atom/teletype/issues/293 is pretty similar to this issue? Trying to run a compiler package on a guest will get a file not found error - I went ahead and closed as a duplicate of this issue, but let me know if it should be separate.

Svahnen commented 6 years ago

I dont know if this helps, but i got linter to work as a guest by unchecking this in the linter version i am using skarmavbild 2018-03-22 kl 11 18 21