Different packageRules for release and prelease versions - semantic-versioning

Is there a way to configure renovate with packageRules, so that I get a MR with automerge disables for pre-release versions, like v1.0.0-alpha.1 and MR with automerge enabled for patch versions, liken v1.0.0.
I have enabled unstableVersion support in renovate, but I want different behaviors for release/prerelease versions. My current configuration looks like the following, but I am unsure if this works, because the documenation of renovate states that prerelases is not a valid value for matchUpdateTypes.
{
"matchDatasources": [
"git-tags"
],
"matchManagers": [
"ansible-galaxy"
],
"matchUpdateTypes": [
"patch"
],
"enabled": true,
"automerge": true,
"platformAutomerge": true
},
{
"matchDatasources": [
"git-tags"
],
"matchManagers": [
"ansible-galaxy"
],
"matchUpdateTypes": [
"prerelease"
],
"enabled": true,
"automerge": false,
"platformAutomerge": false
},
What I want is that renovate automerges
v1.0.0 -> v1.0.1
v1.0.2-alpha.1 -> v1.0.2
but no automerge (only MR) for
v1.0.0 -> v1.0.1-alpha.1
v1.0.1-alpha.1 -> v1.0.1-alpha.2

According to https://docs.renovatebot.com/modules/versioning/#regular-expression-versioning, you could set "ignoreUnstable": true

Related

ESLint options - overrideConfig not loading

I installed ESLint and set these settings in setting.json but EsLint does not start properly globally for VS Code.
Invalid Options: - Unknown options: envs, globals, parserOptions, rules
- 'envs' has been removed. Please use the 'overrideConfig.env' option instead.
- 'globals' has been removed. Please use the 'overrideConfig.globals' option instead.
- 'parserOptions' has been removed. Please use the 'overrideConfig.parserOptions' option instead.
- 'rules' has been removed. Please use the 'overrideConfig.rules' option instead.
These are my settings:
"eslint.options": {
"envs": [
"es6",
"browser",
"node",
"mocha"
],
"globals": [
"expect"
],
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"semi": "error",
"curly": "error",
"quotes": [
"warn",
"single"
],
"no-undef": "error"
}
},
In case you are still looking for an answer, I just had the same issue.. You need to wrap your eslint options into an overrideConfig object. In this case the aimed object in the error message overrideConfig.(...) will be provided correctly.
Similar issue here

My vs code will flicker when I save. I turned on black and flake8 and formatonSave. Why does it flicker? How to stop it?

I have the following workspace settings for my Django project in VSCODE.
{
"folders": [
{
"path": "."
}
],
"settings": {
"python.pythonPath": "/Users/kim/.pyenv/versions/3.7.7/bin/python3.7",
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
"editor.tabSize": 4,
"[javascript]": {
"editor.tabSize": 2
},
"[json]": {
"editor.tabSize": 2
},
"[markdown]": {
"editor.tabSize": 2
},
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true,
"python.linting.flake8Enabled": true,
"python.linting.pylintArgs": ["--enable=unused-import", "--enable=W0614"],
"python.formatting.provider": "black",
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"workbench.iconTheme": "vscode-icons",
"editor.formatOnSave": true
}
}
You can see how it flickers as I press Cmd+S to save the file. From this gif
Why does this flickering happen? I can understand if it happens once. But it will flicker back and forth. As if vscode is formatting on save between two different formats and cannot make its mind.
How do I properly solve this issue?
Ok I realized I found the issue and solution.
Basically the issue is that there are two formatters used to sort the imports.
I use the answer in this github comment
https://github.com/microsoft/vscode-python/issues/6933#issuecomment-543059396
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports.python": true
}
},
"python.formatting.blackArgs": ["--line-length", "88"],
"python.sortImports.args": [
"--multi-line=3",
"--trailing-comma",
"--force-grid-wrap=0",
"--use-parentheses",
"--line-width=88",
],
Notice I change the organizeImports to organizeImports.python.
Also I added a "python.formatting.blackArgs": ["--line-length", "88"]. This is to be consistent with the line-length.
It was suggested in another issue for the same problem. I tried that alone but didn't work. So I combined that with the sortImports args

#angular/cli: 1.4.1 Angular Generate Component but it returns home.component.css

$npm install -g #angular/cli
$ng new angular --routing --style=sass
$ng g c home
"apps": [
{
"styles": [
"styles.sass"
],
}
"defaults": {
"styleExt": "sass",
"component": {
}
}
I want to sass style in angular, I use angular cli, I try to generate component it returns with style with prefix css. May you help me to fixing that? Thanks in advance for your answer.
To override the default style, you can use the option --style [css|scss|sass]:
ng g c home --style=css
I just migrated from #angular/cli#1.0.3 to #angular/cli#1.4.2 and I am facing the same issue. Turns out it's due to a bug introduced in v1.4.1 so we can only wait for a new angular-cli release that will fix this bug.
In v1.4.1 also the apps.prefix is ignored but this was fixed in v1.4.2.
In the mean time, the workaround provided by #Derlin can be used.
github issues on this topic:
https://github.com/angular/angular-cli/issues/7624
https://github.com/angular/angular-cli/issues/7682
https://github.com/angular/angular-cli/issues/7644
https://github.com/angular/angular-cli/issues/7647
https://github.com/angular/angular-cli/issues/7522
update:
The issue is fixed in #angular/cli#1.4.3. Check this release note.
#angular/cli: Generating component considers default style extension
for project now
Here is my defaults that works :
"defaults": {
"styleExt": "scss",
"prefixInterfaces": false,
"inline": {
"style": false,
"template": false
},
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
}
Otherwise, you can just rename it.

eslint Failures in Travis CI, but not locally

I have a GitHub project that has passed Travis CI. Upon creating a pull request for a new feature, Travis CI fails both pr and push due to two eslint errors:
/home/travis/build/enove/Thriver/packages/thriver-accounts/lib/accounts.js
121:5 error Strings must use singlequote quotes
122:5 error Strings must use singlequote quotes
Lines 119 through 122 of accounts.js are as follows:
119: return `Hello ${user.profile.firstname}!\n\n` +
120: `To verify your account email, simply click the link below.\n\n${url}\n\n` +
121: `If you weren't expecting this email, simply delete it.\n\n` +
122: `Thanks!\n\nAll of us at WCASA`;
The commit did not even change accounts.js, and a local eslint passes without error. I checked and verified that the versions of node, npm, and meteor are the same locally as they are in Travis CI.
The Travis CI configuration is as follows:
{
"sudo": "required",
"language": "node_js",
"node_js": "4.1.1",
"before_install": [
"curl -L https://git.io/ejPSng | /bin/sh"
],
"env": "CXX=g++-4.8",
"addons": {
"apt": {
"sources": [
"ubuntu-toolchain-r-test"
],
"packages": [
"g++-4.8"
]
}
},
"services": "mongodb",
"script": [
"meteor npm run lint"
],
"group": "stable",
"dist": "precise",
"os": "linux"
}
The .eslintrc is as follows:
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"impliedStrict": true
}
},
"env": {
"browser": true,
"node": true,
"mongo": true,
"meteor": true
},
"extends": [
"airbnb"
//"plugin:meteor/recommended"
],
"globals": {
"Thriver": true,
"SimpleSchema": true,
"Marked": true,
"SHA256": true,
"google": true,
"geoXML3": true,
"AutoForm": true,
"details_shim": true
},
"rules": {
"no-underscore-dangle": 0,
"new-cap": 0
}
}
This has happened before in a different file and I "resolved" the issue by having eslint ignore the line. But I can't do that for every mystery issue. Any advice?
http://eslint.org/docs/rules/quotes
This is most likely the fix to your problem.
JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example:
/*eslint-env es6*/
var double = "double";
var single = 'single';
var backtick = `backtick`; // ES6 only
The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded of expressions to be interpreted). Many codebases require strings to be defined in a consistent manner.
I would try setting one of these rules and running the tests again.
Let me know if this does not fix your problem!
I still have no idea how eslint was passing locally. Perhaps I was behind in eslint or airbnb version. However, I realized that the lines really did need to be corrected. The bottom two lines of code should not use back ticks because there aren't any variables in those strings.
119: return `Hello ${user.profile.firstname}!\n\n` +
120: `To verify your account email, simply click the link below.\n\n${url}\n\n` +
121: 'If you weren\'t expecting this email, simply delete it.\n\n' +
122: 'Thanks!\n\nAll of us at WCASA';
Eslint is a lot happier with a concatenated string of different styles than a consistent one where not every segment contains a variable.

Gyp: generate x64 Visual Studio solution

After generating a .sln and .vcxproj from the gyp file below msbuild fails with
"C:\proj\test\test.sln" (default target) (1) ->
(ValidateSolutionConfiguration target) ->
C:\proj\test\test.sln.metaproj : error MSB4126: The specified soluti
on configuration "Default|X64" is invalid. Please specify a valid
solution conf iguration using the Configuration and Platform
properties (e.g. MSBuild.exe Sol ution.sln /p:Configuration=Debug
/p:Platform="Any CPU") or leave those properti es blank to use the
default solution configuration. [C:\proj\test\test.sln]
how do I make gyp generate a Default|x64 solution?
{
'targets': [
{
'target_name': 'test',
'type': 'executable',
'sources': [
'test.cpp',
],
},
],
}
Probably you need to have declared target configuration and use it as a default value of target_default, similar to this:
{
'target_defaults': {
'default_configuration': 'Release_x64',
'configurations':
{
'Debug': {
# configuration specific settings
},
'Release': {
# configuration specific settings
},
'Debug_x64': {
'inherit_from': ['Debug'],
'msvs_configuration_platform': 'x64',
},
'Release_x64': {
'inherit_from': ['Release'],
'msvs_configuration_platform': 'x64',
},
},
},
'targets': [
{
'target_name': 'test',
'type': 'executable',
'sources': [
'test.cpp',
],
},
],
}

Resources