Atom не работает linter

Не получается заставить работать Атом ЛИНТЕР

Я новичок в Atom, редактировании текста, и я установил много пакетов, включая Linter

Но он не показывает ошибок и не выделяет код, его просто игнорируют.

Кто-нибудь из вас знает, что мне нужно сделать, чтобы это сработало?

6 ответов

Вам необходимо дополнительно установить пакет linter для желаемого языка.

Вот мой .eslintrc. Надеюсь, это поможет.

Читайте также:  Брелок сигнализации старлайн не работает кнопка открытия

Мне пришлось добавить путь к каталогу node_modules моего проекта в настройки пакета eslint атома, а также создать файл .eslinterc.json в моем проекте. После того, как я выполнил оба этих действия, мне пришлось перезапустить атом (я запустил его из командной строки $ atom . ), и он начал работать. Надеюсь, это кому-то поможет.

Когда я запускаю Atom, небольшая панель пользовательского интерфейса в нижнем левом углу присутствует, но показывает нулевые значения для трех уровней серьезности.

Если я затем сделаю ctrl-s / save (даже без изменений), он начнет работать ..

В настройках моего пакета у меня отмечены галочки «Lint on Open» (который, похоже, вообще не работает) и «Lint on Change» (что «только для поддерживаемых провайдеров», может быть так).

Вместо того, чтобы открывать атом с терминала, как я обычно это делаю, я открыл его с помощью значка приложения. Затем атом спрашивает, можно ли установить зависимости линтера, и, прежде всего, он работает.

Надеюсь это поможет.

Мне нужно было удалить конфигурацию атома и начать с нуля, чтобы линтер заработал

Источник

Настройка Atom от GitHub для работы с PHP, Python и некоторыми другими языками программирования

Изначально считаем что у Вас установлена поддерживаемая операционная система, Node.JS и Atom. В примерах мы работаем в OpenSUSE (13.1) в нём (и вообще в дистрибутивах *nix) уже «из коробки» обычно есть не только Python но PHP и другие языки программирования. Так же исправно работает на Ubuntu (>12.04). Если у Вас Windows 7 или 8, а раньше Вы с ними (языками) не работали то их предварительно необходимо скачать и установить.
Примечание: перед началом работы желательно запускать Atom под root.
опыт показывает — работает стабильнее

Linter

Идеология Atom к подсветке в том, что основным пакетом для работы с синтаксисом и его анализа будет Linter, который является верхним уровнем в API для других линтеров кода. Это сделано для прекращения «войны между плагинами» (The idea is to stop the linter plugins war, by providing a top level API for linters to parse and display errors in the Atom editor). Тем не менее, не все сторонние разработчики придерживаются этой идеологии и пишут свои плагины.

  • linter-php , для PHP `php -l`
  • linter-phpcs , для PHP, `phpc`
  • linter-phpmd , для PHP, `phpmd`
  • linter-pylint , для Python, `pylint`
  • linter-pyflakes , для python, `pyflakes`
  • linter-pep8, для python, `pep8`
  • linter-flake8, для python, `flake8`
  • linter-javac , для Java, `javac`
  • linter-jshint , для JavaScript and JSON, `jshint`
  • linter-jscs , для JavaScript, `jscs`
  • linter-scss-lint , для SASS/SCSS, `scss-lint`
  • linter-coffeelint , для CoffeeScript, `coffeelint`
  • linter-csslint , для CSS, `csslint`
  • linter-rubocop , для Ruby and Ruby on Rails, `rubocop`
  • linter-tslint , для Typescript, `tslint`
  • linter-xmllint , для XML, `xmllint`
  • linter-shellcheck , для Bash, `shellcheck`
  • linter-scalac , для Scala, `scalac`
  • linter-clang , для C / C++, `clang`
  • linter-ruby , для ruby, `ruby -wc`
  • linter-lua , для Lua, `luac -p`

Пакет Script: запуск программ из Atom

Script — пакет для запуска кода в atom.

Установка пакета Script, возможна из командной строки:

или меню
Packages->Settings View->Install->Packages

Каждый язык работает, при наличии предварительно установленного компилятора / интерпритатора.
Пакет Script обновляется довольно часто. Например поддержка Swift появилась менее двух недель назад. Так что скорее всего в ближайшее время появится поддержка новых языков.

Для запуска программы необходимо выбрать
Packages—>Script—>Run

Дополнительные опции можно найти в документации либо на страницах Atom`а или проекта.

Для функционирования должен быть создан рабочий каталог.
Путь к нему нужно прописать здесь:
Packages—>Script—>Configure Script—>Current Working Directory
Заявку разработчикам на поддержку нового языка можно оставить здесь (отвечают быстро)

И немного юмора от разработчиков пакета Script,
у которых, судя по всему, спрашивают всё на свете:

первод: Атом не может найти Нод | Руби | Питон | Мои носки

Python

Поддержка подсветки этого языка идёт изначально. Пакеты для работы с синтаксисом и отладки:
Linter + Language Python + Linter Python Pep8 + Script

Script запускает код на Python, а Linter и Linter Python Pep8 покажут синтаксические ошибки.
Возможно Вам, для работы с Python также поможет Atom Python Debugger.
Подсветка ошибок и запуск после установки будут выглядеть так:

Swift

Терминал

Для запуска исполняемого кода С, C++, Java иногда проще использовать сторонний пакет (не пакет Atom, а пакет вашего дистрибутива), который запускается через терминал, поскольку сам Atom поддерживает большое количество языков. Если Atom выступает в качестве редактора кода, a терминал рядом запускает его — это очень удобно для нас, поскольку терминал не имеет такое преимущество редактирования, как Atom.
Для запуска терминала в окне Atom установите пакет Term. Для запуска терминала в окне Atom выбрать
Packages—>Command Palette—>Toggle и Term
с нужными параметрами.

В заключении ещё один интересный кликабельный анимационный gif от разработчиков script, ссылки.

Источник

Can’t get Atom Linter to work

I’m new to Atom, the text edit, and I installed many packages, including Linter

But it’s not showing errors or highlighting code, it’s just getting ignored.

Do any of you know what I should do to get this to work?

6 Answers 6

You have to additionally install a linter package for your desired language.

I needed to remove atom config and start from scratch to make linter working

/.atom/config.cson did the trick for me.

/.atom.bak. You can copy them one by one. Or do what Fransesc do. Or better use vscode

Instead of opening atom from the terminal like I normally do, I opened it from the application icon. Then atom asks if it was ok to install linter dependencies and presto it was working.

Hope this helps.

When I start Atom up, the small ui panel in bottom left is present, but shows zero values for the 3 severities.

If I then do a ctrl-s/save (even with no changes), it starts working..

In my package settings, I have «Lint on Open» (which doesn’t seem to work at all) and «Lint on Change» (which is «only for supported providers» so could be that) ticked.

i had to add the path of my project’s node_modules dir to the atom’s eslint package settings, as well as create an .eslinterc.json file in my project. After doing both those, i had to restart atom (i started it from the command line $ atom . ) and it started working. Hope this helps someone.

Here is my .eslintrc. Hope it helps.

Not the answer you’re looking for? Browse other questions tagged lint atom-editor or ask your own question.

Linked

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.10.18.40487

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

Linter not working #11

Comments

Nachot93 commented Oct 30, 2015

Hello, I´m new to Atom and I´m loving it so far but I can´t get linter working with C, it always says «No issues», I dont know if it´s this package linter-gcc or linter itself, I´ve googled everywhere but I can´t find the solution.

Any help is much appreciated

The text was updated successfully, but these errors were encountered:

hebaishi commented Oct 30, 2015

Hello. Could you please do the following: open the javascript console in atom, and look for the linter-gcc messages. It prints all its command-line parameters to the console, so the first thing to do is to copy those parameters and try to run them directly in the command-line.

Nachot93 commented Oct 30, 2015

I am so sorry but I don’t know how to do that, I toggled developer tools but I don’t know what to do from there, can you guide me through the process if it isn’t much trouble?
Thanks again

hebaishi commented Oct 30, 2015

Of course. With ‘developer tools’ on, you should see a sidebar, and at the bottom of this sidebar you’ll see a button that says ‘console’. Click it to view the console. Then go back to your C/C++ source file, and press Ctrl+S to save and trigger the linter. When you do this, you’ll see something like this appear in the console:

These are your command-line parameters. The first is the g++ binary, and the rest is the parameters given to g++. So, if we consider the example above, my full command would be:

You need to reconstruct your command in this way and run it in your terminal/command prompt to find out what g++/gcc is reporting.

Nachot93 commented Oct 30, 2015

Okay, I got this:

/usr/bin/g++
main.js:149 [«-Wall», «-fmax-errors=0», «C:\Users\Nacho-PC2\Documents\TP FINAL.cpp»]

Then I changed it to this:

/usr/bin/g++main.js:149 -Wall, -fmax-errors=0, C:\Users\Nacho-PC2\Documents\TP FINAL.cpp

I have Windows, so I assume you mean put that in the cmd, I did that from the .atom directory (don´t know if this is right) and it says «The system cannot find the path specified.»

I surely must be doing something wrong.
Damn, I hate being new to stuff 😛

hebaishi commented Oct 30, 2015

Ok there are a few problems here:

  1. You need to remove the main.js:149 from your command. You also need to remove all the commas.
  2. It looks like you are trying to run /usr/bin/g++. Windows does not have a /usr/bin so this probably won’t work on windows. You need to go into the linter-gcc configuration page and put the full location of the g++ binary in there. If you don’t have one, I suggest you look at installing something something like mingw on windows.
  3. Secondly, you have a space in your file path. This will cause problems because a file path with spaces will cause gcc/g++ to parse part of your file path as a parameter, which it will complain about. To get around this problem, either change your file path and replace ALL spaces with underscores, or enclose the path within double quotes.

Nachot93 commented Oct 30, 2015

/usr/bin/g++ -Wall -fmax-errors=0 C:\Users\Nacho-PC2\Documents\TPFINAL.cpp

  1. I already have MinGW, so I guess the path that I´m looking for is:

Also, by configuration page, you mean the linter-gcc/lib/main.js? Because I found this in there:

execPath: <
type: «string»,
default: «/usr/bin/g++»

Maybe this is the problem?

  1. Done, see 1).

hebaishi commented Oct 30, 2015

No. That is not it. In the menu bar, click Packages > Settings view. Then click packages on the left and select linter-gcc. There you will find the linter-gcc settings. The first one is the executable path. Set that to your executable path, in your case C:\MinGW\g++.exe .

Nachot93 commented Oct 30, 2015

Okay, you left out the bin folder 😛
But it´s working now, but the lint on the fly isn´t, I have to save the file for linter to show me the errors, any workaround this?

hebaishi commented Oct 30, 2015

No, this is deliberate. The reason it works like this is because C/C++ linting can be quite computationally intensive, so linting on-the-fly can cause high CPU load, especially with large files/projects.

Nachot93 commented Oct 30, 2015

Ohhhhh, got it, well it’s working perfectly now! Thanks a lot! 🙂

If it’s no bother, I’ve got another question about Atom, but it’s not related to linter-gcc, is there a private message button somewhere?

hebaishi commented Oct 30, 2015

Yes, that’s fine. You can send me a message on twitter. My handle is hebaishi_husam. I’m closing this issue.

ghost commented Jul 12, 2016

I am trying to follow the instructions here to get linter-gcc working in windows and I am not having success. No output displays in the console when I save

hebaishi commented Jul 13, 2016

Hello. I’m gonna upload a guide for Windows users today because it seems a large number of users have this problem.

What you need to do is:

  1. Set the linter-gcc executable path to g++.exe or gcc.exe
  2. Add your MinGW bin to the system path by following the instructions here. Note that you need to add the MinGW bin path to the end. So if your PATH variable reads C:\Windows\ , and your MinGW bin path is C:\MinGW\bin , your new PATH variable should read C:\Windows\;C:\MinGW\bin . Note the use of the semicolon separator.

Once you have made this change, linter-gcc should work.

ghost commented Jul 13, 2016

Thanks for the response. I did change the executable path to C:\MinGW\bin\g++.exe and also added C:\MinGW\bin to both the path system and user variables. I still don’t see anything show up for linter-gcc in the console when I save.

hebaishi commented Jul 13, 2016

Hello. Your linter-gcc executable path should be set to g++.exe , NOT C:\MinGW\bin\g++.exe . This is because windows needs to find g++.exe in your system path. Also, once you have changed your system PATH in the system properties, you might need to restart Atom for the change to take effect.

ghost commented Jul 13, 2016

great thank you for your reply. It is working now

charozard commented Jul 29, 2016

Hi hebaishi,
I’m sorry to bring this back up again but I’ve encountered a similar problem which appears persistent despite following instructions above. Linter is failing to find a number of standard c++ libraries including string and iostream, though using g++ to compile the same files in terminal works just fine. Do you have any suggestions on remedying this issue? Would the «GCC include paths» setting be the place to look? If so, which path ought I include?

KarateBrot commented Apr 15, 2017

Same for me. I followed the instructions. I can compile without errors in Atom but I still get the linter error:
GCC | «iostream: No such file or directory»

AliAytacAyhan commented Jul 27, 2017

how to know the path which linter has installed ?

bqUAB commented Mar 9, 2018

I can confirm that the fix works but after various unsuccessful tries I found my solution for Windows 7.
Follow @hebaishi instructions about the installation of Cygwin and setting the PATH variable.
Test PATH by opening a new CMD and typing gcc –v
Close Atom and GitHub Desktop
Reopen and test if it works now.

Источник

Оцените статью