Sublime REPL terminal issue - python-3.x

Recently I started using sublime 3 text editor and the issue I encountered is the REPl terminal, I mean why is there syntax highlighting and autocompletion in a terminal during execution, it makes the terminal annoying, is there any fix?

Go to .sublime-settings file, add "auto_complete": false in SublimeRepl user settings.
"repl_view_settings": {
"translate_tabs_to_spaces": false,
"auto_indent": true,
"smart_indent": true,
"spell_check": false,
"indent_subsequent_lines": false,
"detect_indentation": false,
"auto_complete": false,
"line_numbers": true,
"gutter": true
},
If this doesn't work, go to SublimeREPL/config/Python/Main.sublime-menu, search for autocomplete_server and set it to false.

Related

How to to globally disable E501 in VSCODE and pylama

I am using Visual Studio Code and pylama linter.
Currently I am added # noqa to every long line to avoid the following linter message:
line too long (100 > 79 characters) [pycodestyle]pylama(E501)
I've added "--disable=E501" to VSCODE's workspace settings.json file as shown below:
{
"editor.tabSize": 2,
"editor.detectIndentation": false,
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": false,
"python.linting.pycodestyleEnabled": false,
"python.linting.pylamaEnabled": true,
"[python]": {
"editor.tabSize": 4
},
"python.linting.pylama": [
"--disable=E501"
]
}
but still I get E501.
How can I disable E501 in my VSCODE workspace for good?
For other linters, the .settings file seems to be looking for
python.linting.<linter>Args
so I recommend trying:
"python.linting.pylamaArgs": [
"--ignore=E501"
]
or potentially
python.linting.pylamaArgs": ["--disable=E501"]
See also: https://code.visualstudio.com/docs/python/settings-reference#_pylama
that seems to suggest the same:
pylamaArgs [] Additional arguments for pylama, where each top-level element that's separated by a space is a separate item in the list.

VSCode: Prettier does not work with Dart Flutter

I am using Dart and Node.js. I tried to auto format Node.js with Prettier. However, VSCode auto formats Dart file but it does not format JavaScript with Prettier.
Under the screen, it says Prettier on JavaScript. When I touch the setting and set it to Prettier for auto format, Prettier works and it auto format JS files but Dart auto format does not work.
How can I set VSCode to auto format Dart and JS files without switching settings everytime?
VSCode Setup
{
"workbench.colorTheme": "Visual Studio Dark",
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [
80
],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false
},
"workbench.preferredHighContrastColorTheme": "Default Dark+",
"files.autoSave": "afterDelay",
"editor.minimap.enabled": false,
"dart.openDevTools": "flutter",
"explorer.confirmDragAndDrop": false,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
!!!! Solution
"editor.defaultFormatter": "Dart-Code.dart-code",
You need to add this line to setting.json Dart part. And then set your default formatter to Prettier!
Don't set Prettier as VS Code's global default formatter. Set to only be the default formatter where Javascript is concerned. Open your settings JSON and add the following:
{
...
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
I took a combination of the answer and comments above and used it to solve the problem I had, which was Firebase Cloud Function JavaScript/Typescript and Flutter/Dart code in the same VSCode project.
Create a .vscode folder in the root of your project.
Create a settings.json file inside of it.
Add the following and tweak to your liking. In the main VSCode settings, you can find a cog in the left gutter next to each setting that has a "Copy setting to JSON" menu item, which you can then paste into the below and adjust to override the application-level settings.
Decide whether to .gitignore your new folder or share it with your team.
Restart VSCode
{
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[dart]": { "editor.defaultFormatter": "Dart-Code.dart-code" },
"editor.formatOnSave": true
}

sublime text 3 anaconda stop working after restart

I have installed Anaconda package using package controle.
I have the following user settings for the package:
{
/*
No Autoformatting
*/
"auto_formatting": false,
"autoformat_ignore":
[
"E309",
"E501"
],
"pep8_ignore":
[
"E309",
"E501"
],
/*
No Linting (this is done by sublinter-flake8)
*/
"anaconda_linting": false,
"anaconda_linter_underlines": false,
"anaconda_linter_mark_style": "none",
"display_signatures": true,
/*
Use anaconda for code completion
Suppress sublime completions
*/
"disable_anaconda_completion": false,
"suppress_word_completions": true,
"suppress_explicit_completions": true,
"enable_signatures_tooltip" : true,
"merge_signatures_and_doc" : true,
/*
Others
*/
"complete_parameters": false
}
Right after installation The anaconda autocompletion works:
but after restart of sublime text 3 it stop working:
sublime text 3 version - 3.2.2 build 3211
could you please help to understand what I'm doing wrong or what settings need to add to make it working after restart?

Suppressing nightwatchjs warnings in terminal output

I'm using nightwatchjs to run my test suite, and I would like to remove the warning messages being outputted to my terminal display.
At the moment, I'm getting loads of these (admittedly genuine) warning messages whilst my scripts are running and it's making the reading of the results harder and harder.
As an example;
Yes they are valid messages, but it's not often possible for me to uniquely pick out each individual element and I'm not interested in them for my output.
So, I'd like to know how I can stop them from being reported in my terminal.
Below is what I've tried so far in my nightwatch.conf.js config file;
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled : true,
acceptSslCerts: true,
acceptInscureCerts: true,
chromeOptions : {
args: [
'--ignore-certificate-errors',
'--allow-running-insecure-content',
'--disable-web-security',
'--disable-infobars',
'--disable-popup-blocking',
'--disable-notifications',
'--log-level=3'],
prefs: {
'profile.managed_default_content_settings.popups' : 1,
'profile.managed_default_content_settings.notifications' : 1
},
},
},
},
but it's still displaying the warnings.
Any help on this would be really appreciated.
Many thanks.
You can try setting detailed_output property to false in the configuration file. This should stop these details from printing in the console.
You can find a sample config file here.
You can find relevant details available under Output Settings section of official docs here.
Update 1: This looks like a combo of properties which controls this and the below combo works for me.
live_output: false,
silent: true,
output: true,
detailed_output: false,
disable_error_log: false,

Testacular/Karma: how to reuse browser's tab?

Each time I re-run Karma, it opens new Chrome window although there is already one on the screen and with the same URL in it.
How to make Karma runner to reuse browser window and if appropriate tab was opened - reuse this tab?
In the config, set
browsers = [];
I've landed here while looked for the same question in a bit different context.
When running tests, there are cases where Karma immediately opens 2 tabs, so that all tests are running twice. Usually this should not be an issue, but in our case that causes some unexpected latencies and sporadic failures.
Indeed, in order to prevent this unwanted behaviour one should add the following to the Karma configuration:
restartOnFileChange: true
This, by Karma's spec, is forcing a runner to stop the current execution and start a fresh one, thus effectively reusing the same current tab.
Default behaviour, restartOnFileChange: false, causes to start a new execution while the current one is continuing to run, thus effectively producing 2 concurrently running tabs.
Add the following line inside the config.set({...}) block:
restartOnFileChange: false,
which is a guarantee.
With that line, whenever you save your file/files, the browser will REFRESH itself automatically instead of reopening.
Just in case, the following is my complete karma.conf.js file, which is very efficient:
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '#angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('#angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
random: false
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, 'coverage'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: false,
});
};
In the block, I added the following myself:
jasmine: {
random: false
},
which makes your "it" blocks show in the order the same as they are in your spec file;
and
restartOnFileChange: false,
whose function is what you want and I've already mentioned above.
You can open your code coverage file in src/coverage/index.html of your project.
Note: Sometimes chrome doesn't refresh automatically after you save a file/files. You just refresh it manually, and the whole test will restart. Very simple.

Resources