Skip to content

Commit

Permalink
Merge pull request SCons#4546 from Repiteo/enforce-editorconfig
Browse files Browse the repository at this point in the history
Enforce `.editorconfig` line-ending settings
  • Loading branch information
bdbaddog authored Jun 2, 2024
2 parents dd949a9 + 09c4a12 commit 432ec8a
Show file tree
Hide file tree
Showing 104 changed files with 8,755 additions and 8,745 deletions.
8 changes: 4 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

[*.py]
max_line_length = 78
[{*.py,SConstruct,SConscript}]
max_line_length = 88
ensure_newline_before_comments = true
include_trailing_comma = true
use_parentheses = true

[*.xml]
[*.{xml,yml,yaml}]
indent_size = 2

[*.rst]
indent_size = 3

[*.bat]
[*.{bat,cmd,ps1}]
end_of_line = crlf
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# files reformatted from DOS line-endings
1277d8e5ab6457ed18d291100539f31d1bdb2d7c
# enforced .editorconfig eol settings
fbb026ef1145fe29e0ec3c1b66a3e99cac51e18d
7 changes: 5 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
* text=auto eol=lf
*.bat eol=crlf
*.cmd eol=crlf
*.ps1 eol=crlf

doc/* linguist-documentation
SCons/Tool/docbook/docbook-xsl-1.76.1 linguist-vendored
*.xml linguist-documentation
*.xsl linguist-documentation
*.gen linguist-documentation

*.in eol=lf
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
- GetSConsVersion() to grab the latest SCons version without needing to
access SCons internals.
- Migrate setup.cfg logic to pyproject.toml; remove setup.cfg.
- Update .gitattributes to match .editorconfig; enforce eol settings.

From Raymond Li:
- Fix issue #3935: OSErrors are now no longer hidden during execution of
Expand Down
4 changes: 4 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ DEVELOPMENT
by adding SKIP_PDF=1. This should help with distro packaging of SCons,
which now does not need "fop" and other tools to be set up in order to
build pdf versions which are then ignored.
- .gitattributes has been setup to mirror .editorconfig's eol settings.
The repo-wide line-ending is now `lf`, with the exception of a few
Windows-only files using `crlf` instead. Any files not already fitting
this format have been explicitly converted.


Thanks to the following contributors listed below for their contributions to this release.
Expand Down
128 changes: 64 additions & 64 deletions test/AR/ARCOM.py
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
#!/usr/bin/env python
#
# MIT License
#
# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"""
Test the ability to configure the $ARCOM construction variable.
"""

import TestSCons

_python_ = TestSCons._python_

test = TestSCons.TestSCons()

test.file_fixture('mycompile.py')
test.file_fixture('myrewrite.py')

test.write('SConstruct', """
DefaultEnvironment(tools=[])
env = Environment(tools=['default', 'ar'],
ARCOM = r'%(_python_)s mycompile.py ar $TARGET $SOURCES',
RANLIB = True,
RANLIBCOM = r'%(_python_)s myrewrite.py ranlib $TARGET',
LIBPREFIX = '',
LIBSUFFIX = '.lib')
env.Library(target = 'output', source = ['file.1', 'file.2'])
""" % locals())

test.write('file.1', "file.1\n/*ar*/\n/*ranlib*/\n")
test.write('file.2', "file.2\n/*ar*/\n/*ranlib*/\n")


test.run(arguments = '.')

test.must_match('output.lib', "file.1\nfile.2\n")

test.pass_test()

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
#!/usr/bin/env python
#
# MIT License
#
# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"""
Test the ability to configure the $ARCOM construction variable.
"""

import TestSCons

_python_ = TestSCons._python_

test = TestSCons.TestSCons()

test.file_fixture('mycompile.py')
test.file_fixture('myrewrite.py')

test.write('SConstruct', """
DefaultEnvironment(tools=[])
env = Environment(tools=['default', 'ar'],
ARCOM = r'%(_python_)s mycompile.py ar $TARGET $SOURCES',
RANLIB = True,
RANLIBCOM = r'%(_python_)s myrewrite.py ranlib $TARGET',
LIBPREFIX = '',
LIBSUFFIX = '.lib')
env.Library(target = 'output', source = ['file.1', 'file.2'])
""" % locals())

test.write('file.1', "file.1\n/*ar*/\n/*ranlib*/\n")
test.write('file.2', "file.2\n/*ar*/\n/*ranlib*/\n")


test.run(arguments = '.')

test.must_match('output.lib', "file.1\nfile.2\n")

test.pass_test()

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
134 changes: 67 additions & 67 deletions test/AR/ARCOMSTR.py
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
#!/usr/bin/env python
#
# MIT License
#
# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"""
Test that the $ARCOMSTR construction variable allows you to customize
the displayed archiver string.
"""

import TestSCons

_python_ = TestSCons._python_

test = TestSCons.TestSCons()

test.file_fixture('mycompile.py')
test.file_fixture('myrewrite.py')

test.write('SConstruct', """
DefaultEnvironment(tools=[])
env = Environment(tools=['default', 'ar'],
ARCOM = r'%(_python_)s mycompile.py ar $TARGET $SOURCES',
ARCOMSTR = 'Archiving $TARGET from $SOURCES',
RANLIB = True,
RANLIBCOM = r'%(_python_)s myrewrite.py ranlib $TARGET',
LIBPREFIX = '',
LIBSUFFIX = '.lib')
env.Library(target = 'output', source = ['file.1', 'file.2'])
""" % locals())

test.write('file.1', "file.1\n/*ar*/\n/*ranlib*/\n")
test.write('file.2', "file.2\n/*ar*/\n/*ranlib*/\n")

test.run()

expect = 'Archiving output.lib from file.1 file.2'
test.must_contain_all_lines(test.stdout(), [expect])
test.must_match('output.lib', "file.1\nfile.2\n")

test.pass_test()

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
#!/usr/bin/env python
#
# MIT License
#
# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"""
Test that the $ARCOMSTR construction variable allows you to customize
the displayed archiver string.
"""

import TestSCons

_python_ = TestSCons._python_

test = TestSCons.TestSCons()

test.file_fixture('mycompile.py')
test.file_fixture('myrewrite.py')

test.write('SConstruct', """
DefaultEnvironment(tools=[])
env = Environment(tools=['default', 'ar'],
ARCOM = r'%(_python_)s mycompile.py ar $TARGET $SOURCES',
ARCOMSTR = 'Archiving $TARGET from $SOURCES',
RANLIB = True,
RANLIBCOM = r'%(_python_)s myrewrite.py ranlib $TARGET',
LIBPREFIX = '',
LIBSUFFIX = '.lib')
env.Library(target = 'output', source = ['file.1', 'file.2'])
""" % locals())

test.write('file.1', "file.1\n/*ar*/\n/*ranlib*/\n")
test.write('file.2', "file.2\n/*ar*/\n/*ranlib*/\n")

test.run()

expect = 'Archiving output.lib from file.1 file.2'
test.must_contain_all_lines(test.stdout(), [expect])
test.must_match('output.lib', "file.1\nfile.2\n")

test.pass_test()

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
Loading

0 comments on commit 432ec8a

Please sign in to comment.