mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
fix(pep440): keep spacing consistency for complex ranges
This commit is contained in:
parent
7620fcbca8
commit
77cd757bc9
2 changed files with 6 additions and 1 deletions
|
@ -76,7 +76,7 @@ function getNewValue(
|
||||||
logger.warn('Arbitrary equality not supported: ' + currentValue);
|
logger.warn('Arbitrary equality not supported: ' + currentValue);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const result = ranges
|
let result = ranges
|
||||||
.map(range => {
|
.map(range => {
|
||||||
// used to exclude versions,
|
// used to exclude versions,
|
||||||
// we assume that's for a good reason
|
// we assume that's for a good reason
|
||||||
|
@ -133,6 +133,10 @@ function getNewValue(
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.join(', ');
|
.join(', ');
|
||||||
|
|
||||||
|
if (result.includes(', ') && !currentValue.includes(', ')) {
|
||||||
|
result = result.replace(/, /g, ',');
|
||||||
|
}
|
||||||
|
|
||||||
if (!satisfies(toVersion, result)) {
|
if (!satisfies(toVersion, result)) {
|
||||||
// we failed at creating the range
|
// we failed at creating the range
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|
|
@ -108,6 +108,7 @@ describe('pep440.getNewValue()', () => {
|
||||||
|
|
||||||
// complex ranges
|
// complex ranges
|
||||||
['~=1.1.0, !=1.1.1', '~=1.2.3, !=1.1.1'],
|
['~=1.1.0, !=1.1.1', '~=1.2.3, !=1.1.1'],
|
||||||
|
['~=1.1.0,!=1.1.1', '~=1.2.3,!=1.1.1'],
|
||||||
|
|
||||||
// invalid & not supported
|
// invalid & not supported
|
||||||
[' ', ' '],
|
[' ', ' '],
|
||||||
|
|
Loading…
Reference in a new issue