Editorconfig not warning about indentation - ubuntu-16.04

I discovered editorconfig but I cannot get it to notify me about incorrect indentation.
I installed editorconfig on ubuntu 16.04:
editorconfig -v
EditorConfig C Core Version 0.12.0
In a directory, I setup the configuration within an .editorconfig file:
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
Then I create a text file test.txt only using 1 space for indentation:
This is a test.
It only uses one space.
I would like editorconfig to notify me.
Because I set it to have 2 spaces.
When I run the command:
editorconfig $(pwd)/test.txt
I just get the config back:
charset=utf-8
end_of_line=lf
indent_style=space
indent_size=2
insert_final_newline=true
trim_trailing_whitespace=true
tab_width=2
When I open the file in atom (with the atom editorconfig plugin installed and activated), I do see the mouse icon down in the status bar. It warns me about the whitespace package.
When I deactivate the atom whitespace package, I don't see any icon in the nav bar.
Still in atom, when I use the command EditorConfig: Show State I get a green notification telling me that everything is ok.
When I use the command EditorConfig: Fix file, I get:
The file test.txt conformed to the end_of_line and indent_style properties. No changes were applied.
I looked all over the place in the documentation and on the internet.
I've spent about an hour on this thing.
I don't get it.
Clearly the indentation is incorrect.
Still, why can't I get any notification?
What am I obviously missing?

Related

Can VSCode shows spaces for me and tabs for a colleague?

Our repo has indent with 2 spaces. My colleague prefers tabs. Can VSCode does a conversions to tabs while opening a file?
I've tried EditorConfig extension for VSCode but it doesn't format a file on open. The file is opened with 2 spaces even if I have this .editorconfig:
[*]
indent_style = tabs
indent_size = 4
Note: We use Prettier in pre-commit hook to format everything.

IPython tab completion menu colors are unreadable

Tab completion in IPython is practically unusable because the text is so difficult to read.
Here's what I've tried:
I didn't have an ipython configuration file so I created one:
ipython profile create.
In my ipython_config.py I set c.InteractiveShell.colors = 'NoColors'. That made all my text white but the completion text didn't change.
I'm using the following software:
kitty terminal: 0.14.1
IPython: 7.5.0
Pygments: 2.4.2
prompt-toolkit: 2.0.9
I found a solution. It seems my terminal is using 24bit color and that must be interacting poorly with the defaults of IPython which defaults to 256 colors. You can test your terminal with this command:
printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n"
If you see 'TRUECOLOR', then your terminal supports true color.
I set that in my ipython_config.py file: c.TerminalInteractiveShell.true_color = True. Now the completion text is readable.

Unable to get any linting done in github's atom editor (using Linter + Linter Pylint)

Text Editor: Atom v 0.140.0
Installed version of Linter: 0.7.3
Installed version of Linter Pylint: 0.1.5
Version of Atom: 0.140.0
Running on Linux Mint 16
Pylint version: pylint 0.26.0,
astng 0.24.1, common 0.59.1
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1]
Issue: Both the packages (linter and linter pylint) are installed and enabled but no linting is being done in case of errors.
For example
priont "asdf" doesn't show any kind of error message.
I had this same problem on Windows 8 but was able to fix it by editing the config.cson file in Atom. After you've downloaded your linters, you need to first get the full path (file location) for the linter. Then, go into the config.cson file and you should see all the linters you've downloaded somewhere in the file. For example, I was trying to get pylint to work. In the config file there should be quotations containing your specific linter somewhere in the file, for example, mine has a line of code that just read:
"linter-pylint": {}
Delete the brackets, and in the line under the name of your linter (keep the colon and it should auto indent the next line) add "path: " and then the full path name of your linter. So I changed my pylint to
"linter-pylint":
path: "C:Users/Student/.atom/packages/linter-pylint"
then I restarted Atom and the linter was working just fine. The same method worked for the C++ linter clang.
Note: you also might need to do the same thing for the generic linter itself; i.e. your file might contain a line that just says
"linter": {}
I dont know if you ever solved this, or you are still interested, but I ran into the same problem recently and solved it by downgrading the linter version.
Just run apm install linter#1.2.4
There was an issue opened at the github page: https://github.com/atom-community/linter/issues/815

Copy and paste in Eclipse adds window newlines at the end of each pasted line

I am using Eclipse (Version: Indigo Service Release 2) on Mac OS X (10.7) with PHP Development Tools and Aptana Studio 3 Plugin.
In Preferences > General > Workspace I have selected:
- Text file encoding = UTF-8
- New text file line delimiter = Unix
In Preferences > General > Editors > Text Editors I have enabled "Show whitespace characters".
I also use "File > Convert Line Delimiters To > Unix" to regularly change any windows newlines.
Copy-paste of text adds windows newlines (^M) characters at the end of whole lines in the pasted text. This happens despite the fact that the text copied is "clean" of Windows new line characters. This happens for all copy-pasted text (from the same file/editor, or from other sources) if it has at least one whole line in it. I noticed the behavior in git commits.
I believe I have exhausted all possible explanations and did not find anything in my research.
I suspect the Aptana Plugin is the problem because I have a second (separate) installation of Eclipse with all set as above minus the Aptana plugin and never experienced something similar. Nevertheless I can not find anything in Aptana preferences that would look like a potential solution.
Any ideas before I call this a bug?
I had exactly the same annoying problem. After some research and experimentation I think I found the source of the bug and a workaround.
Observations on my set up (Eclipse 3.7.2, PDT 3.0.0, no aptana):
it only occurred for me in PHP files inside the <?php ?> delimiters.
it only occurred when pasting while the cursor is somewhere on a line with only whitespace. After pasting, all whitespace was removed.
When there was a non whitespace character on the line, it did not occur. When pasting in front of the non-whitespace character, the whitespace in front of the character was however removed.
This behavior felt like an issue with automatic indentation handling, so I tried dis-/enabling indentation related options.
Disabling the following option fixed it for me:
PHP > Editor > Typing > When pasting adjust indentation
good luck

Mercurial Eclipse Error

I am trying to use mercurial in eclipse. I downloaded mercurial eclipse plugin for this.
But, despite I had reinstalled it many times, it gives the same error, I put the screenshot below.
Checking encoding (cp1254)...
Checking extensions...
Checking templates...
Checking patch...
Checking commit editor...
Can't find editor 'notepad' in PATH
(specify a commit editor in your configuration file)
Checking username...
1 problems detected, please check your install!. Command line: hg -y debuginstall
I do not know how to handle this. Any help will be appreciated very much, thank you.
I encountered the same problem when I tried to run Eclipse x64 on Win 7 x64. The MercurialEclipse seems not able to access C:\windows\system32\ folder, although it has been specified in system PATH.
You need to specify the location of editor in the Mercurial.ini file. This file is located at c:\Users\<your_username>\mercurial.ini.
Under the username = ... line, add a line to specify the editor (see following). Remember not to put quotes around the path.
[ui]
username = <username>
editor = c:\Windows\System32\notepad.exe
(Note: similar to bug 13505 in Mercurial Eclipse project)
The Eclipse inherits the path from your current session.
Open a DOS session, and check if said session does have notepad in its path (which it should considering notepad is in C:\Windows\system32\notepad.exe). Make sure C:\Windows\system32 (or %SystemRoot%\system32) is in first position in your PATH (in case of side effect with other paths with spaces or special characters in it).
If the path is correct, then launch the eclipse from that command-line DOS windows, and see if the problem persists.
The OP emre reports its %PATH% being:
C:\Program Files\NVIDIA Corporation\PhysX\Common;
C:\Program Files\Java\jdk1.6.0_20\bin;
D:\eclipse-java-helios-sr1-win32\eclipse\android-2.2_r0-windows\android-2.2_r0-windows\tools;
C:\Program Files\Java\jdk1.6.0_20\bin
In other word, no %SystemRoot%\system32.
You need to edit the System variables in the Environment variable settings of Windows, and add in the first place in the PATH variable:
%SystemRoot%\system32
Then you can open a new DOS session, launch eclipse from there and ot should work fine.
i had the same problem and searched for hours till i tried to escape the backslash in the path for the editor.
so i edited the mercurial.ini (on my win7) like this:
[ui]
username = <username>
editor = c:\\Windows\\System32\\notepad.exe
and it worked.
Three additions:
It seems that Tortoise HG 3.3 configuration utility added my editor
setting to [tortoisehg] section rather than the [ui] section of
mercurial.ini For Eclipse Mercurial to work, the editor path must also be in
the [ui] section. Otherwise, eclipse will have this error.
using forward slash suitably substitutes for the escaped backslash
On Windows 8.1, notepad easily starts from the command prompt (on
system path) and yet the error above still occurs. In my hands the
general system path advice given above seems off target
One other thing to look at is the HGEDITOR environment variable, which overrides the editor setting in mercurial.ini. I had HGEDITOR set to C:\Windows\System32\notepad.exe, which didn't work (due to the unescaped backslashes), and all my changes to mercurial.ini were ignored. Changing HGEDITOR to C:\\Windows\\System32\\notepad.exe finally got rid of the Mercurial Eclipse errors.