Skip to content

Commit

Permalink
Normalization of line ending with exclusion of test directories (#8007)
Browse files Browse the repository at this point in the history
Add git attributes for automatic line ending normalization.

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
  • Loading branch information
zenlyj and Pierre-Sassoulas authored Jan 2, 2023
1 parent 1baa10e commit 259b3d7
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 44 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto
tests/**/functional/** -text
tests/input/** -text
tests/**/data/** -text
tests/regrtest_data/** -text
10 changes: 5 additions & 5 deletions doc/data/messages/c/consider-ternary-expression/bad.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
x, y = input(), input()
if x >= y: # [consider-ternary-expression]
maximum = x
else:
maximum = y
x, y = input(), input()
if x >= y: # [consider-ternary-expression]
maximum = x
else:
maximum = y
4 changes: 2 additions & 2 deletions doc/data/messages/c/consider-ternary-expression/pylintrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[MAIN]
load-plugins=pylint.extensions.consider_ternary_expression
[MAIN]
load-plugins=pylint.extensions.consider_ternary_expression
4 changes: 2 additions & 2 deletions doc/data/messages/c/consider-using-ternary/bad.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
x, y = 1, 2
maximum = x >= y and x or y # [consider-using-ternary]
x, y = 1, 2
maximum = x >= y and x or y # [consider-using-ternary]
2 changes: 1 addition & 1 deletion doc/data/messages/d/disallowed-name/bad.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def foo(): # [disallowed-name]
def foo(): # [disallowed-name]
pass
12 changes: 6 additions & 6 deletions doc/data/messages/e/else-if-used/bad.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if input():
pass
else:
if len(input()) >= 10: # [else-if-used]
pass
else:
if input():
pass
else:
if len(input()) >= 10: # [else-if-used]
pass
else:
pass
2 changes: 1 addition & 1 deletion doc/data/messages/e/else-if-used/pylintrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[MAIN]
[MAIN]
load-plugins=pylint.extensions.check_elif
6 changes: 3 additions & 3 deletions doc/data/messages/i/import-error/details.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This can happen if you're importing a package that is not installed in your environment, or if you made a typo.

The solution is to install the package via pip/setup.py/wheel or fix the typo.
This can happen if you're importing a package that is not installed in your environment, or if you made a typo.

The solution is to install the package via pip/setup.py/wheel or fix the typo.
10 changes: 5 additions & 5 deletions doc/data/messages/i/import-self/bad.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from bad import a_function # [import-self]


def a_function():
pass
from bad import a_function # [import-self]


def a_function():
pass
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Another reasonable option is to use f-string. If you want to do that, you need to enable
Another reasonable option is to use f-string. If you want to do that, you need to enable
``logging-format-interpolation`` and disable ``logging-fstring-interpolation``.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This message permits to allow f-string in logging and still be warned of
This message permits to allow f-string in logging and still be warned of
``logging-format-interpolation``.
4 changes: 2 additions & 2 deletions doc/data/messages/u/use-a-generator/details.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
By using a generator you can cut the execution tree and exit directly at the first element that is ``False`` for ``all`` or ``True`` for ``any`` instead of
calculating all the elements. Except in the worst possible case where you still need to evaluate everything (all values
By using a generator you can cut the execution tree and exit directly at the first element that is ``False`` for ``all`` or ``True`` for ``any`` instead of
calculating all the elements. Except in the worst possible case where you still need to evaluate everything (all values
are True for ``all`` or all values are false for ``any``) performance will be better.
8 changes: 4 additions & 4 deletions doc/data/messages/u/use-dict-literal/details.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
https://gist.github.com/hofrob/ad143aaa84c096f42489c2520a3875f9

This example script shows an 18% increase in performance when using a literal over the
constructor in python version 3.10.6.
https://gist.github.com/hofrob/ad143aaa84c096f42489c2520a3875f9

This example script shows an 18% increase in performance when using a literal over the
constructor in python version 3.10.6.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import final


@final # [using-final-decorator-in-unsupported-version]
class Playtypus(Animal):
@final # [using-final-decorator-in-unsupported-version]
def lay_egg(self):
...
from typing import final


@final # [using-final-decorator-in-unsupported-version]
class Playtypus(Animal):
@final # [using-final-decorator-in-unsupported-version]
def lay_egg(self):
...
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class Playtypus(Animal):
def lay_egg(self):
...
class Playtypus(Animal):
def lay_egg(self):
...

0 comments on commit 259b3d7

Please sign in to comment.