profile
viewpoint

adrienverge/coucharchive 10

Create and restore backups of a whole CouchDB server, with simple tar.gz files

adrienverge/arm-analyser 6

ARM binaries analyser

adrienverge/copr-couchdb 5

Unofficial CouchDB 2 packages for CentOS 7

adrienverge/copr-some-nice-fonts 5

Some nice fonts including Arial, Courier New, Helvetica, etc. for Fedora and CentOS

adrienverge/context_unnester 1

Fixes Python source code that use contextlib.nested.

adrienverge/copr-oauth2_proxy 1

Fedora & CentOS packages for oauth2_proxy (previously Google Auth Proxy)

adrienverge/aiocouch 0

🛋 An asynchronous client library for CouchDB 2.x

adrienverge/angular 0

One framework. Mobile & desktop.

adrienverge/angular-cli 0

CLI tool for Angular

push eventadrienverge/localstripe

Hoel IRIS

commit sha e1a9580cb0981f7428a56fd4ae4d7f7e39449367

refactor: Rename a variable to fix lint rule E741 Log of the CI before this commit: ``` $ if [[ $TRAVIS_PYTHON_VERSION != nightly ]]; then flake8 .; fi ./localstripe/resources.py:594:47: E741 ambiguous variable name 'l' The command "if [[ $TRAVIS_PYTHON_VERSION != nightly ]]; then flake8 .; fi" exited with 1. ```

view details

push time in a day

PR merged adrienverge/localstripe

refactor: Rename a variable to fix lint rule E741

Log of the CI before this commit:

$ if [[ $TRAVIS_PYTHON_VERSION != nightly ]]; then flake8 .; fi
./localstripe/resources.py:594:47: E741 ambiguous variable name 'l'
The command "if [[ $TRAVIS_PYTHON_VERSION != nightly ]]; then flake8 .; fi"
exited with 1.
+1 -1

0 comment

1 changed file

H--o-l

pr closed time in a day

issue commentadrienverge/yamllint

quoted-strings only-when-needed doesn't work properly for multiline strings

Thanks for the report! Contributions to fix this are welcome.

tjanez

comment created time in 4 days

issue commentadrienverge/yamllint

TypeError: 'NoneType' object is not iterable

Hehe. You can see an example of a full configuration here: https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration

mgedmin

comment created time in 4 days

issue commentadrienverge/yamllint

TypeError: 'NoneType' object is not iterable

Hi Marius,

I'm glad you managed to get it to work again :+1:

If using an empty rules: once worked, it was a hidden feature that was never meant to exist. For clarity and consistency, I think it's better to stick to what rules is (a dict). I agree a more friendly error message would be better.

mgedmin

comment created time in 5 days

issue commentadrienverge/yamllint

Yamllint pre-commit and direct invocation yield inconsistent results

Thanks for confirming this.

Please note that pre-commit support directly from this repo will be dropped in a future version.

cansjt

comment created time in 5 days

issue commentadrienverge/yamllint

No vscode extensions supporting yamllint

Thanks for documenting this @ssbarnea. I'll close because this is not directly related to yamllint, but you have my encouragement to write an extension for your favorite editor :+1:

ssbarnea

comment created time in 5 days

issue closedadrienverge/yamllint

No vscode extensions supporting yamllint

Sadly there is no vscode extension available for using yamllint, which is quite sad as vscode become most popular non-terminal editor.

We should either do one of these:

  • add yamllint support for another linting extension
  • write an extension (easier that it appears)
  • document a way to enable support for it

closed time in 5 days

ssbarnea

issue commentadrienverge/yamllint

Enabling parsable output should not be mutually exclusive with colored mode

Hello,

Currently yamllint provides a standard, human-readable, potentially colored format. This is the main output format. The parsable format was then added, but is designed for machines only. I'm not sure there are many users that would like a custom parsable-but-colored format.

ssbarnea

comment created time in 5 days

issue commentadrienverge/yamllint

BUG: quoted-strings only-when-needed with hashtag

Hi Sergey,

Thanks for reporting this. I confirm the bug.

sergey-alekseev

comment created time in 5 days

issue commentadrienverge/yamllint

Unacceptable character #x1f44b: special characters are not allowed in "<unicode string>"

@butaca isn't it a duplicate of https://github.com/adrienverge/yamllint/issues/48? Can you check the version of PyYAML you have?

butaca

comment created time in 6 days

created tagadrienverge/openfortivpn

tagv1.14.1

Client for PPP+SSL VPN tunnel services

created time in 11 days

push eventadrienverge/openfortivpn

Dimitri Papadopoulos

commit sha 355a80338fcd47d5151eed21fe24fc440f6c3442

openfortivpn version 1.14.1

view details

push time in 11 days

issue closedadrienverge/openfortivpn

openfortivpn version 1.14.1

I would like to release a new version of openfortivpn to fix issue #715.

closed time in 11 days

DimitriPapadopoulos

pull request commentadrienverge/openfortivpn

openfortivpn version 1.14.1

Thanks!

DimitriPapadopoulos

comment created time in 11 days

issue commentadrienverge/yamllint

Enhancement: Option to apply style

Isn't it a duplicate of #209, #62, #230 and #231?

Le ven. 15 mai 2020 à 23:09, Andrew notifications@github.com a écrit :

For large collections of YAML files, it would be helpful to offer an automated CLI flag to go ahead and format the files per yamllint configuration. Maybe a --apply option?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adrienverge/yamllint/issues/269, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIAQEKPJRKNFMMZXYUDAD3RRWVSBANCNFSM4NCSDCCA .

mcandre

comment created time in 16 days

created tagadrienverge/openfortivpn

tagv1.14.0

Client for PPP+SSL VPN tunnel services

created time in 21 days

push eventadrienverge/openfortivpn

Dimitri Papadopoulos

commit sha 363898661f842c0cab6449aa6c206531c015d4d2

openfortivpn version 1.14.0

view details

push time in 21 days

issue closedadrienverge/openfortivpn

openfortivpn version 1.14.0

I would like to release a new version of openfortivpn.

I'm pretty confident in the stability of this version. The most invasive change is 5574b45296e26ebdb25a8824f003d69a75b6f609, but it has been reviewed and tested. This will help apply more invasive changes in the future, such as HTTP and XML parsing using 3rd party code.

the majority of changes consist in cleaning up headers and the build system. There might be a few minor issues at build-time but I don't expect any at run-time. I have tested this version on Linux (Ubuntu 20.04, Fedora 31 and CentOS 8) and FreeBSD 12.1. I hope to be able to test on Mac OS soon.

closed time in 21 days

DimitriPapadopoulos

pull request commentadrienverge/openfortivpn

openfortivpn version 1.14.0

Thanks!

DimitriPapadopoulos

comment created time in 21 days

push eventadrienverge/rhythmbox_playlist_to_m3u

Domenic Fiore

commit sha 589b0fcec2d79e813be115599d464c9fed6bf074

Replace illegal characters in filenames with underscores

view details

push time in 22 days

PR merged adrienverge/rhythmbox_playlist_to_m3u

Script will replace illegal characters in a filename with an underscore.

Thanks a lot for making this script, it really saved me from doing some annoying copying. I had to make a change because my playlist name had a slash in it, so the program was trying to write to "/tmp/Outrun/Synthwave". Now it writes to "/tmp/Outrun_Synthwave" instead.

I would appreciate it if you add a LICENSE and AUTHORS file to this project if you can.

Let me know if you want me to change anything here.

+3 -3

0 comment

1 changed file

DomenicF

pr closed time in 22 days

push eventadrienverge/rhythmbox_playlist_to_m3u

Adrien Vergé

commit sha 41a42f858dbbd61903c37ac0759c0e6674bd3532

Add LICENSE file This project is licensed under GPL version 3.

view details

push time in 22 days

issue commentadrienverge/yamllint

Indentation of lists

@mboehm21 that's it. Your style is perfectly valid, but uncommon. If you want yamllint to enforce the indentation rule on your files, using either "space space dash space" or "dash space" should work :+1:

mboehm21

comment created time in 24 days

Pull request review commentadrienverge/yamllint

Fix confusing ReadError traceback

 def test_sets(self):                    '    a:\n'                    '      set\n'                    '...\n', None)++    def test_non_printable_characters(self):+        self.check('output: \x1b\n',+                   None, problem=(1, 9))

Please add more tests. At the least I can think of:

  • invalid character in the first byte,
  • invalid character in the last byte,
  • invalid character not on line 1,
  • multiple invalid characters,
  • test with other rules enabled.
ssbarnea

comment created time in 24 days

Pull request review commentadrienverge/yamllint

Fix confusing ReadError traceback

 def get_syntax_error(buffer):                               'syntax error: ' + e.problem + ' (syntax)')         problem.level = 'error'         return problem+    except yaml.reader.ReaderError as e:+        # we need to convert position into line+column+        lines = buffer[:e.position].splitlines()

@webknjaz very good point, and your solution looks good. The column one needs a small adaptation because it wouldn't work if the invalid char is on the first line.

        line = buffer.count('\n', 0, e.position)
        col = e.position - (buffer.rindex('\n', 0, e.position) if line else 0)
        problem = LintProblem(line + 1, col + 1,

ssbarnea

comment created time in 24 days

issue commentadrienverge/yamllint

Indentation of lists

Hello,

You want to have 2 spaces for dicts, and 1 space for lists, right?

yamllint rule indentation tries to enforce a consistent indentation, which means you can't use this rule to check custom mixed indentations values like this, I'm afraid.

mboehm21

comment created time in 24 days

push eventadrienverge/dotfiles

Adrien Vergé

commit sha 98608ed4840379475875453aa12d59bfca90c2b7

fix(Vim): Fix Neomake + eslint failing since Fedora 32

view details

push time in 24 days

issue commentangular/angular

Translate TypeScript multi-line template literal using $localize

Sure, fair point. It's just sad there isn't a way to use $localize with long strings splitted on multiple lines (without introducing lots of spaces ), as it seems a very common use-case. Anyway, thanks for your feedback @petebacondarwin!

bravier

comment created time in 25 days

issue commentadrienverge/openfortivpn

Revisit running openfortivpn as root?

@adrienverge Do you recall whether PPP is enforced by the VPN gateway? Are there any alternatives to PPP, such as the TUN interface suggested by @zez3?

I'm sorry, I don't know :/

DimitriPapadopoulos

comment created time in 25 days

issue commentangular/angular

Translate TypeScript multi-line template literal using $localize

I.E. improve unwrapStringLiteralArray() to be able to handle arrays of binary expressions where the binary expression is a concatenation of strings.

That makes sense!

But at some point we are venturing into partial evaluation of the code, which I'd like to avoid.

Could it be possible to use a simple reducing function, without evaluating anything? Something like that (not tested):

 export function unwrapStringLiteralArray(array: t.Expression): string[] {
+  if (!isArray(array)) {
+    throw new BabelParseError(
+        array, 'Unexpected messageParts for `$localize` (expected an array of strings).');
+  }
+  array = array.map(expression => {
+    if (expression.kind === ts.SyntaxKind.BinaryExpression &&
+        expression.operatorToken.kind === ts.SyntaxKind.PlusToken &&
+        typeof expression.left === 'string' && typeof expression.right === 'string') {
+      return expression.left + expression.left;
+    }
+    return expression;
+  });
+
   if (!isStringLiteralArray(array)) {
     throw new BabelParseError(
         array, 'Unexpected messageParts for `$localize` (expected an array of strings).');
   }
   return array.elements.map((str: t.StringLiteral) => str.value);
 }
bravier

comment created time in 25 days

issue commentadrienverge/openfortivpn

Revisit running openfortivpn as root?

What was the rationale behind using the pppd command instead of directly using a PPP library? Did any C PPP libraries exist in the first place?

Either they didn't exist, or I wasn't aware of them. If they now exist and work, they could be a solution.

DimitriPapadopoulos

comment created time in 25 days

issue commentangular/angular

Translate TypeScript multi-line template literal using $localize

Hello, I take the liberty of intervening because I share the same problem.

It's desirable to avoid many extra spaces, like 3 × in:

              title = $localize`Long long long paragraph
                                that does NOT contain new lines (\\n)
                                but actually is 280 chars long
                                and would hardly fit in one line`;

... for various reasons:

  • the ones described by @bravier,
  • it confuses human (non-dev) translators,
  • indenting or deintending the surrounding code block cause problems too.

Is there a way to use $localize differently (e.g. with $localize([string], attr)?) to allow breaking strings on multiple lines? For instance, in many languages it's usual to write:

              title = _('Long long long paragraph ' +
                        'that does NOT contain new lines (\\n) ' +
                        'but actually is 280 chars long ' +
                        'and would hardly fit in one line');
bravier

comment created time in a month

issue commentadrienverge/openfortivpn

Migrating from autotools to CMake

I don't see a need to change. I'm not against it, but unless I miss something switching from autotools to CMake doesn't solve any existing problem.

faustocarva

comment created time in a month

pull request commentadrienverge/yamllint

Fix confusing ReadError traceback

Wow, reviving a PR after one day is a bit too much. I have concerns about this commit, I'll take the time to think about it. Please be patient.

ssbarnea

comment created time in a month

Pull request review commentadrienverge/yamllint

Add contribution instructions in CONTRIBUTING.rst

+Contributing+============++Pull requests are the best way to propose changes to the codebase.+Contributions are welcome, but they have to meet some criteria.++Pull Request Process+--------------------++1. Fork this Git repository and create your branch from ``master``.++2. Make sure the tests pass:++   .. code:: bash++    python setup.py test++3. If you add code that should be tested, add tests.++4. Make sure the linters pass:

Same reason as for your other posts: I want these instructions to be simple and understandable for everyone.

adrienverge

comment created time in a month

issue commentadrienverge/yamllint

Unable to control parsable format from configuration file

Sounds like a good addition! Do you want to solve this problem?

This could look like this:

extends: default

format: parsable  # ←

ignore: |
  *.dont-lint-me.yaml

rules:
  key-duplicates: enable
ssbarnea

comment created time in a month

issue commentadrienverge/yamllint

Project maintenance and development

I first want to thank @adrienverge for writing the yamllint as this proved to be very useful tool for assuring style consistency and preventing various common bugs. I used that for many years and introduced it to many projects.

You're welcome!

Still, recently I realized that many open-source projects that depend on a single person can prove to be a serious liability for anyone that relies on them. I saw all kind of problems, from maintainer disappearing, going rogue, domain expiring, CI/CD getting broken and not fixed for long time, failure or very long delays in reviewing contributions or failure to make a new release in time.

I've seen that too.

I don't think yamllint suffers from this problem, I read every issue and pull request, answer when it's relevant, and (correct me if I'm wrong) response time is decent. I don't think an umbrella organization would help.

Everyone is invited to contribute, but also to help maintaining. I would love if you (meaning: anyone, not only @ssbarnea) reviewed pull requests before I do. Currently this is not the case.

About a CI/CD pipeline, this is a good idea. Do you want to help contributing this?

ssbarnea

comment created time in a month

push eventadrienverge/yamllint

Sorin Sbarnea

commit sha bbcad943b677f0b59ffc056fb6659cfcab0e6f91

style: Ignore flake8 warnings W503 and W504 Avoid W503/W504 with current code as the current code not compliant and they are contradictory.

view details

push time in a month

PR merged adrienverge/yamllint

Added flake8 ignores

Avoid W503/W504 with current code as the current code not compliant and they are contradictory.

+1 -0

2 comments

1 changed file

ssbarnea

pr closed time in a month

issue commentadrienverge/yamllint

Test warnings in 1.16.0

For pytest users there is a nice way to disable these warnings, see an example at https://github.com/ansible-community/molecule/blob/master/setup.cfg#L144-L152 -- in fact it may be possible to do it for other test runners too.

Interesting, thanks! Do you have a solution that would work for all runners, without adding dependencies?

Personally I would not mind dropping support for py27 sooner. A maintenance branch could be created for emergency patches, if the need arises (I had a single case where I had to pin-down one of my dependencies).

That's smart, but I don't feel these warnings are "really annoying", at least not enough to create and maintain an extra branch. Python 2 support will be dropped at the end of the year.

yurivict

comment created time in a month

delete branch adrienverge/yamllint

delete branch : docs/contributing

delete time in a month

push eventadrienverge/yamllint

Adrien Vergé

commit sha 30c90dbf70456a3a265cfac522ad4032309d47e3

Add contribution instructions in CONTRIBUTING.rst Closes https://github.com/adrienverge/yamllint/issues/263.

view details

push time in a month

PR merged adrienverge/yamllint

Add contribution instructions in CONTRIBUTING.rst

Closes https://github.com/adrienverge/yamllint/issues/263.

+44 -0

1 comment

1 changed file

adrienverge

pr closed time in a month

issue closedadrienverge/yamllint

add contribution instructions

Apparently there is no documentation about how to contribute to the project, chat or mailing list and maybe more important about how to perform testing.

For a Python project I was surprised not to see a tox file, which could have addressed the lack of testing information quite well.

Users can guess some stuff by looking at the travis config but that gives very poor reproducibility, for example running flake8 locally gives very different results than on travis, same applies to running tests (huge number of W504 line break after binary operator errors)

I think that using tox would be highly desirable for easing the contributions, and also very easy to add.

closed time in a month

ssbarnea

issue commentadrienverge/yamllint

add contribution instructions

@ssbarnea you're right about contribution instructions, I'll add that.

I'm not in favor of adding tox config or any other config, because I want tests to be runnable by anybody (from outside the Python ecosystem), without having to install dependencies or read extra documentation.

ssbarnea

comment created time in a month

push eventadrienverge/yamllint

Adrien Vergé

commit sha 749e38b396ce96a18b5e1e0f5f1e7d42975db489

Add contribution instructions in CONTRIBUTING.rst Closes https://github.com/adrienverge/yamllint/issues/263.

view details

push time in a month

PR opened adrienverge/yamllint

Add contribution instructions in CONTRIBUTING.rst

Closes https://github.com/adrienverge/yamllint/issues/263.

+44 -0

0 comment

1 changed file

pr created time in a month

push eventadrienverge/yamllint

Adrien Vergé

commit sha 92b66209cb5477d2d12236e649233521aa845ea3

Add contribution instructions in CONTRIBUTING.rst Closes https://github.com/adrienverge/yamllint/issues/263.

view details

push time in a month

create barnchadrienverge/yamllint

branch : docs/contributing

created branch time in a month

issue commentadrienverge/yamllint

[question] Where is yamllint installed?

It depends on many things; can you give more informations? Your system, the command you use to install yamllint, what this commands said, what does $PATH contain, etc.

rockerdaddy

comment created time in a month

issue closedadrienverge/yamllint

Empty lines in comments not handled sensibly by require-starting-space

Problem Comments like this:

[Line 32 of yml file]
      # - name: some task
      #   import_role:
      #     name: some-role
      #
      # - name: some task
      #   import_role:
      #     name: some-role
      #
      # - name: some task
      #   import_role:
      #     name: some-role
      #
      # - name: some task
      #   import_role:
      #     name: some-role

are flagged as needing a leading space after the hash.

$ yamllint ./zz.yml
./zz.yml
  36:8      warning  missing starting space in comment  (comments)
  40:8      warning  missing starting space in comment  (comments)
  44:8      warning  missing starting space in comment  (comments)

Request That makes no sense as it's likely to flag various valid comments. The rule should only be applied to lines with text following the hash. It should not be applied to cases where a newline follows the hash.

Thanks.

closed time in a month

g1ps

issue commentadrienverge/yamllint

Empty lines in comments not handled sensibly by require-starting-space

Yes. Thanks for your contribution @bsolomon1124!

g1ps

comment created time in a month

Pull request review commentadrienverge/yamllint

Bugfix: GH Issue #171 / CRLF wih require-starting-space.

 def check(conf, comment):                     comment.column_no == 1 and                     re.match(r'^!\S', comment.buffer[text_start:])):                 return-            elif comment.buffer[text_start] not in (' ', '\n', '\0'):+            # We can test for both \r and \r\n just by checking first char+            # \r itself is a valid newline on some older OS.+            elif comment.buffer[text_start] not in {' ', '\n', '\r', '\x00'}:

I'm not sure the O(1) search for 4 one-byte elements compensate the overhead of building a set + hashings required, but I admit it's nicer-looking now :wink:

bsolomon1124

comment created time in a month

push eventadrienverge/yamllint

Brad Solomon

commit sha 512fe17047d68f55a885f628f65e005a47b827f4

Fix bug with CRLF in new-lines and require-starting-space Pound-signs followed by a lone CRLF should not raise if require-starting-space is specified. If require-starting-space is true, *and* either: - new-lines: disbale, or - newlines: type: dos is specified, a line with `#\r` or `#\r\n` should not raise a false positive. This commit also uses a Set for O(1) membership testing and uses the correct escape sequence for the nul byte. If we find a CRLF when looking for Unix newlines, yamllint should always raise, regardless of logic with require-starting-space. Closes: Issue #171.

view details

push time in a month

Pull request review commentadrienverge/yamllint

Bugfix: GH Issue #171 / CRLF wih require-starting-space.

 def check(conf, comment):                     comment.column_no == 1 and                     re.match(r'^!\S', comment.buffer[text_start:])):                 return-            elif comment.buffer[text_start] not in (' ', '\n', '\0'):+            # We can test for both \r and \r\n just by checking first char+            # \r itself is a valid newline on some older OS.

OK, the problem becomes simpler then.

This does no handle examples like:

---\n
#\rcomment\n

and:

---\r\n
#\r[end of file]

... but I guess it's acceptable to ignore those.

bsolomon1124

comment created time in a month

issue commentadrienverge/openfortivpn

Move routing and name resolution changes into an external script?

I'm sorry, I have no idea...

DimitriPapadopoulos

comment created time in a month

issue commentadrienverge/openfortivpn

Identify obsolete code and add mechanism to disable it?

Introducing #ifdef OBSOLETE or #ifdef SUPPORT_OBSOLETE_CODE is a good idea! Moving code to obsolete.c: why not, if it helps.

DimitriPapadopoulos

comment created time in a month

issue commentadrienverge/openfortivpn

Move routing and name resolution changes into an external script?

Hey Dimitri, thanks for sharing the idea! I have taken too much distance to give valuable feedback, all I can tell is that running external shell scripts from a sudo program has always scared me. However you seem to say that it would allow running openfortivpn without root privileges, which I see as a very good move. You and Martin have proven to master the code of this repo, so I'll trust the choice you make!

DimitriPapadopoulos

comment created time in a month

push eventadrienverge/yamllint

Will Badart

commit sha 278a79f09385921ef2aff783d5c37f674bcd5080

Mention YAMLLINT_CONFIG_FILE in the documentation

view details

push time in a month

PR merged adrienverge/yamllint

Mention YAMLLINT_CONFIG_FILE in the documentation

Notes the new config file option from #255 in the docs.

+1 -0

2 comments

1 changed file

wbadart

pr closed time in a month

pull request commentadrienverge/yamllint

cli: read optional config from YAMLLINT_CONFIG

@jbergstroem if you want to continue on this pull request, using YAMLLINT_CONFIG_DATA instead of YAMLLINT_CONFIG would be consistent with the new feature from https://github.com/adrienverge/yamllint/pull/255#pullrequestreview-400674082.

jbergstroem

comment created time in a month

PR merged adrienverge/yamllint

Add Python 3.8 to PyPI/trove classifier data

3.8 is now formally supported in .travis.yml as of this commit.

+1 -0

1 comment

1 changed file

bsolomon1124

pr closed time in a month

push eventadrienverge/yamllint

Brad Solomon

commit sha e98aacf62cab52afb7eed81cc0fb44adfb849c76

Add Python 3.8 to PyPI/trove classifier data 3.8 is now formally supported in .travis.yml as of this commit.

view details

push time in a month

issue commentadrienverge/yamllint

Empty lines in comments not handled sensibly by require-starting-space

I don't have all this in mind anymore, but I'd certainly review a PR :+1: (it needs to come with tests, and more importantly not break existing behavior for other platforms)

About:

elif comment.buffer[text_start] not in (' ', '\n', '\r\n', '\0'):

it seemed a good idea, but comment.buffer[text_start] is only one character, so it will never match \r\n. You could try:

elif comment.buffer[text_start] not in (' ', '\n', '\0') and comment.buffer[text_start:text_start+2] != '\r\n':

?

g1ps

comment created time in a month

push eventadrienverge/yamllint

Will Badart

commit sha 94c0416f6b0a45df9efde7117a9c2faa517b1130

Specify config with environment variable YAMLLINT_CONFIG_FILE Add option to specify config file with environment variable. Add test case.

view details

push time in a month

PR merged adrienverge/yamllint

Option to specify config file with environment variable

Hey team-

This PR instructs the CLI to check the YAMLLINTRC environment variable for a global config path. For most intents and purposes, this can be achieved with the -c flag, but I found a corner case where the environment variable is useful: I'd like to point my editor and my CI server at the same config file, and it's much easier to specify the variable once in something like a .env file than tweaking how both systems invoke yamllint individually.

I'm not married to the name "YAMLLINTRC"; please let me know if there's a better name (I've been working with pylint lately, so I think I subconsciously borrowed their convention). Also, please let me know if this is PR is the right place to make the corresponding update to the docs.

Thanks!

+24 -1

3 comments

2 changed files

wbadart

pr closed time in a month

push eventadrienverge/localstripe

Adrien Vergé

commit sha a7009ec96aa65f6232abe1f4607b83b614fb10d4

localstripe version 1.12.4

view details

push time in a month

created tagadrienverge/localstripe

tagv1.12.4

A fake but stateful Stripe server that you can run locally, for testing purposes.

created time in a month

delete branch adrienverge/localstripe

delete branch : fix/subscription-latest-invoice

delete time in a month

push eventadrienverge/localstripe

Adrien Vergé

commit sha 3d80f83a37df1d69fdffb2565f3b1fba85351729

Subscription: Correctly set latest_invoice on manual payment This fixes the following bug: if a subscription was upgraded to a plan with the same billing cycle (e.g. yearly → yearly), and the user generated the invoice manually, then the `Subscription.latest_invoice` wasn't updated to the new value.

view details

push time in a month

PR merged adrienverge/localstripe

Subscription: Correctly set latest_invoice on manual payment

This fixes the following bug: if a subscription was upgraded to a plan with the same billing cycle (e.g. yearly → yearly), and the user generated the invoice manually, then the Subscription.latest_invoice wasn't updated to the new value.

+7 -4

0 comment

1 changed file

adrienverge

pr closed time in a month

delete branch adrienverge/localstripe

delete branch : fix/incorrect-invoice-lines-on-subscription-plan-update

delete time in a month

push eventadrienverge/localstripe

Adrien Vergé

commit sha 9846e257ea0c4a2bdb69a1e6e6d3afa36b6d5483

InvoiceItem: Include 'plan' and 'subscription' info if available That's what real Stripe does, e.g. on a plan upgrade: [ { "id": "il_1GbU4aKxWWXl12QBOzUyETIM", "type": "invoiceitem", "subscription_item": "si_H9nhRadSKnHfBu", "invoice_item": "ii_1GbU4bKxWWXl12QBhGX2ce3u", "amount": -1000, "description": "Unused time on Plan after 24 Apr 2020", "plan": { "id": "monthly-plan", ... }, "proration": true }, { "id": "il_1GbU4bKxWWXl12QCMJnxK6Ws", "type": "subscription", "subscription_item": "si_H9nhRadSKnHfBu", "amount": 9900, "currency": "eur", "description": "1 × Plan (at €99.00 / year)", "plan": { "id": "yearly-plan", ... }, "proration": false } ]

view details

Adrien Vergé

commit sha d8d089c2dd5a228d286f6a47525e27bb1e14270c

Invoice: Create SubscriptionItems (not InvoiceItems) for upcoming This fixes a bug when a subscription is upgraded to another plan with a different billing cycle (e.g. monthly to yearly). In such a case, the invoice is generated when the user creates the invoice then calls API `/pay`, but in this case the invoice is made from `Invoice._get_next_invoice()`, not from `Subscription._create_invoice()`. Subsciption items need to be created as `SubscriptionItem`, not `InvoiceItem` (since commit a80dda2 "feat: Support invoice line items (il_) from Stripe API 2019-12-03").

view details

push time in a month

PR merged adrienverge/localstripe

Fix incorrect invoice lines on subscription plan upgrade

InvoiceItem: Include 'plan' and 'subscription' info if available

That's what real Stripe does, e.g. on a plan upgrade:

[
  {
    "id": "il_1GbU4aKxWWXl12QBOzUyETIM",
    "type": "invoiceitem",
    "subscription_item": "si_H9nhRadSKnHfBu",
    "invoice_item": "ii_1GbU4bKxWWXl12QBhGX2ce3u",
    "amount": -1000,
    "description": "Unused time on Plan after 24 Apr 2020",
    "plan": { "id": "monthly-plan", ... },
    "proration": true
  },
  {
    "id": "il_1GbU4bKxWWXl12QCMJnxK6Ws",
    "type": "subscription",
    "subscription_item": "si_H9nhRadSKnHfBu",
    "amount": 9900,
    "currency": "eur",
    "description": "1 × Plan (at €99.00 / year)",
    "plan": { "id": "yearly-plan", ... },
    "proration": false
  }
]

Invoice: Create SubscriptionItems (not InvoiceItems) for upcoming

This fixes a bug when a subscription is upgraded to another plan with a different billing cycle (e.g. monthly to yearly). In such a case, the invoice is generated when the user creates the invoice then calls API /pay, but in this case the invoice is made from Invoice._get_next_invoice(), not from Subscription._create_invoice().

Subsciption items need to be created as SubscriptionItem, not InvoiceItem (since commit a80dda2 "feat: Support invoice line items (il_) from Stripe API 2019-12-03").

+72 -40

2 comments

2 changed files

adrienverge

pr closed time in a month

Pull request review commentadrienverge/localstripe

Subscription: Correctly set latest_invoice on manual payment

 def __init__(self, customer=None, subscription=None, metadata=None,         self._draft = True         self._voided = False -        if not simulation:+        if not simulation and not upcoming:+            if subscription is not None:+                subscription_obj.latest_invoice = self.id+             schedule_webhook(Event('invoice.created', self))

Yes, totally right!

Before, an invoice.created event was sent the user looked at the next upcoming invoice (GET /v1/invoices/upcoming?customer=cus_n2FydPZCLKMDXk). Now, it's not the case anymore (and I think it makes more sense, but feel free to comment if I'm wrong).

adrienverge

comment created time in a month

push eventadrienverge/localstripe

Adrien Vergé

commit sha 90fa3b11d074bfdcc8091ef8bfe4016c728476df

Invoice: Create SubscriptionItems (not InvoiceItems) for upcoming This fixes a bug when a subscription is upgraded to another plan with a different billing cycle (e.g. monthly to yearly). In such a case, the invoice is generated when the user creates the invoice then calls API `/pay`, but in this case the invoice is made from `Invoice._get_next_invoice()`, not from `Subscription._create_invoice()`. Subsciption items need to be created as `SubscriptionItem`, not `InvoiceItem` (since commit a80dda2 "feat: Support invoice line items (il_) from Stripe API 2019-12-03").

view details

push time in a month

push eventadrienverge/localstripe

Adrien Vergé

commit sha ca3505794e04007e3da568bbe0a44112351d46c1

Invoice: Create SubscriptionItems (not InvoiceItems) for upcoming This fixes a bug when a subscription is upgraded to another plan with a different billing cycle (e.g. monthly to yearly). In such a case, the invoice is generated when the user creates the invoice then calls API `/pay`, but in this case the invoice is made from `Invoice._get_next_invoice()`, not from `Subscription._create_invoice()`. Subsciption items need to be created as `SubscriptionItem`, not `InvoiceItem` (since commit a80dda2 "feat: Support invoice line items (il_) from Stripe API 2019-12-03").

view details

push time in a month

pull request commentadrienverge/localstripe

Fix incorrect invoice lines on subscription plan upgrade

I propose to add the following unit test inside one of the two commit (feel free to change or improve it!):

So nice!!!

I took it as is, and just changed this for a better display (otherwise it's very hard to read and debug), otherwise, thanks :ok_hand:

-echo $in | grep "Abonnement PRO (annuel)"
-echo $in | grep "Abonnement basique (annuel)"
+grep -q "Abonnement PRO (annuel)" <<<"$in"
+grep -q "Abonnement basique (annuel)" <<<"$in"
adrienverge

comment created time in a month

Pull request review commentadrienverge/localstripe

Fix incorrect invoice lines on subscription plan upgrade

 def __init__(self, subscription=None, plan=None, quantity=1,          quantity = try_convert_to_int(quantity)         try:-            assert type(subscription) is str-            assert subscription.startswith('sub_')+            if subscription is not None:

You understand well!

It's tricky, but on special routes, localstripe may have to construct SubscriptionItems without creating a real Subscription. For example when doing a simulation:

GET /v1/invoices/upcoming?customer=cus_n2FydPZCLKMDXk&subscription_items[0][plan]=my=plan&subscription_default_tax_rates[0]=txr_VZ9GmAd2Ka6km0`
adrienverge

comment created time in a month

Pull request review commentadrienverge/yamllint

Option to specify config file with environment variable

 def test_run_with_user_global_config_file(self):             cli.run((os.path.join(self.wd, 'a.yaml'), ))         self.assertEqual(ctx.returncode, 1) +    def test_run_with_user_yamllintrc_config_file(self):+        config = os.path.join(self.wd, 'fake-local-config')+        self.addCleanup(os.remove, config)

In other tests we use: https://github.com/adrienverge/yamllint/blob/a54cbce1b62a37b76eb07479a16dd761d476990c/tests/test_config.py#L216

Maybe it would be better to stay consistent?

wbadart

comment created time in a month

issue commentadrienverge/yamllint

non-yaml files claimed to be correct

lkjlkjkj
XDgvzdfgbnxfgh

is valid YAML, it's a representation of the string "lkjlkjkj XDgvzdfgbnxfgh".

Can you try changing extension from tmp.txt to tmp.yaml and load it with your favorite YAML loader?

pputnik

comment created time in a month

issue commentadrienverge/yamllint

non-yaml files claimed to be correct

Can you please give a reproductible case, and more info on what you expect? It's hard to understand your problem with just one sentence.

pputnik

comment created time in a month

delete branch adrienverge/localstripe

delete branch : refactor/payment-intent-confirm

delete time in a month

push eventadrienverge/localstripe

Adrien Vergé

commit sha 5533d75e8db2aa9a62170368d41486bd2f45c706

PaymentIntent: Refactor passing of confirm and off_session `confirm` and `off_session` are not part of the object itself. They are read only on *creation*, and used only once to confirm the intent: From https://stripe.com/docs/api/payment_intents/create: > When `confirm=true` is used during creation, it is equivalent to > creating and confirming the PaymentIntent in the same call. > You may use any parameters available in the confirm API when > `confirm=true` is supplied.

view details

push time in a month

PR merged adrienverge/localstripe

PaymentIntent: Refactor passing of confirm and off_session

confirm and off_session are not part of the object itself. They are read only on creation, and used only once to confirm the intent:

From https://stripe.com/docs/api/payment_intents/create:

When confirm=true is used during creation, it is equivalent to creating and confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when confirm=true is supplied.


@ImJustToNy this follows #133 and #135. Can you review it or test it? Thanks!

+21 -12

0 comment

1 changed file

adrienverge

pr closed time in a month

Pull request review commentadrienverge/localstripe

PaymentIntent: Refactor passing of confirm and off_session

 def last_payment_error(self):                     'message': charge.failure_message,                 } +    @classmethod+    def _api_create(cls, confirm=None, off_session=None, **data):+        confirm = try_convert_to_bool(confirm)+        off_session = try_convert_to_bool(off_session)+        try:+            if confirm is not None:+                assert type(confirm) is bool+            if off_session is not None:+                assert type(off_session) is bool+                assert confirm is True+        except AssertionError:+            raise UserError(400, 'Bad request')++        obj = super()._api_create(**data)++        if confirm:+            cls._api_confirm(obj)

Ah, of course! Thanks.

Updated:

--- a/localstripe/resources.py
+++ b/localstripe/resources.py
@@ -1630,7 +1630,7 @@ class PaymentIntent(StripeObject):
         obj = super()._api_create(**data)
 
         if confirm:
-            cls._api_confirm(obj)
+            cls._api_confirm(obj.id)
 
         return obj
 
adrienverge

comment created time in a month

push eventadrienverge/localstripe

Adrien Vergé

commit sha f0cfa15e92be3122717c8c8b24db42839133865a

PaymentIntent: Refactor passing of confirm and off_session `confirm` and `off_session` are not part of the object itself. They are read only on *creation*, and used only once to confirm the intent: From https://stripe.com/docs/api/payment_intents/create: > When `confirm=true` is used during creation, it is equivalent to > creating and confirming the PaymentIntent in the same call. > You may use any parameters available in the confirm API when > `confirm=true` is supplied.

view details

push time in a month

PR opened adrienverge/localstripe

Subscription: Correctly set latest_invoice on manual payment

This fixes the following bug: if a subscription was upgraded to a plan with the same billing cycle (e.g. yearly → yearly), and the user generated the invoice manually, then the Subscription.latest_invoice wasn't updated to the new value.

+7 -4

0 comment

1 changed file

pr created time in a month

create barnchadrienverge/localstripe

branch : fix/subscription-latest-invoice

created branch time in a month

push eventadrienverge/localstripe

Adrien Vergé

commit sha 07be81a15b4c4dbc21c969add2af90ec0fcefd72

Invoice: Create SubscriptionItems (not InvoiceItems) for upcoming This fixes a bug when a subscription is upgraded to another plan with a different billing cycle (e.g. monthly to yearly). In such a case, the invoice is generated when the user creates the invoice then calls API `/pay`, but in this case the invoice is made from `Invoice._get_next_invoice()`, not from `Subscription._create_invoice()`. Subsciption items need to be created as `SubscriptionItem`, not `InvoiceItem` (since commit a80dda2 "feat: Support invoice line items (il_) from Stripe API 2019-12-03").

view details

push time in a month

PR opened adrienverge/localstripe

Fix incorrect invoice lines on subscription plan upgrade

InvoiceItem: Include 'plan' and 'subscription' info if available

That's what real Stripe does, e.g. on a plan upgrade:

[
  {
    "id": "il_1GbU4aKxWWXl12QBOzUyETIM",
    "type": "invoiceitem",
    "subscription_item": "si_H9nhRadSKnHfBu",
    "invoice_item": "ii_1GbU4bKxWWXl12QBhGX2ce3u",
    "amount": -1000,
    "description": "Unused time on Plan after 24 Apr 2020",
    "plan": { "id": "monthly-plan", ... },
    "proration": true
  },
  {
    "id": "il_1GbU4bKxWWXl12QCMJnxK6Ws",
    "type": "subscription",
    "subscription_item": "si_H9nhRadSKnHfBu",
    "amount": 9900,
    "currency": "eur",
    "description": "1 × Plan (at €99.00 / year)",
    "plan": { "id": "yearly-plan", ... },
    "proration": false
  }
]

Invoice: Create SubscriptionItems (not InvoiceItems) for upcoming

This fixes a bug when a subscription is upgraded to another plan with a different billing cycle (e.g. monthly to yearly). In such a case, the invoice is generated when the user creates the invoice then calls API /pay, but in this case the invoice is made from Invoice._get_next_invoice(), not from Subscription._create_invoice().

Subsciption items need to be created as SubscriptionItem, not InvoiceItem (since commit a80dda2 "feat: Support invoice line items (il_) from Stripe API 2019-12-03").

+48 -39

0 comment

1 changed file

pr created time in a month

PR opened adrienverge/localstripe

PaymentIntent: Refactor passing of confirm and off_session

confirm and off_session are not part of the object itself. They are read only on creation, and used only once to confirm the intent:

From https://stripe.com/docs/api/payment_intents/create:

When confirm=true is used during creation, it is equivalent to creating and confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when confirm=true is supplied.


@ImJustToNy this follows #133 and #135. Can you review it or test it? Thanks!

+21 -12

0 comment

1 changed file

pr created time in a month

push eventadrienverge/localstripe

Adrien Vergé

commit sha 8ffe7ecc47631f4cb6940b0f3986b7a82021c127

fix(subscriptions): Fix trial_end on creation

view details

Adrien Vergé

commit sha eb3f02a0a5fbf311f1cbc5f04249ba03bc8d47f3

PaymentIntent: Refactor passing of confirm and off_session `confirm` and `off_session` are not part of the object itself. They are read only on *creation*, and used only once to confirm the intent: From https://stripe.com/docs/api/payment_intents/create: > When `confirm=true` is used during creation, it is equivalent to > creating and confirming the PaymentIntent in the same call. > You may use any parameters available in the confirm API when > `confirm=true` is supplied.

view details

push time in a month

issue commentadrienverge/localstripe

Trial_end not working

OK, got it! I merged #132 because it seemed a move in the right direction anyway. Feel free to look into the trialing problem if you want, and propose a better change.

adrianlungu

comment created time in a month

delete branch adrienverge/localstripe

delete branch : fix/trial-end

delete time in a month

push eventadrienverge/localstripe

Adrien Vergé

commit sha 8ffe7ecc47631f4cb6940b0f3986b7a82021c127

fix(subscriptions): Fix trial_end on creation

view details

push time in a month

more