File editorconfig-core-py-0.17.0+git.1743012229.8dca1b6.obscpio of Package python-EditorConfig
07070100000000000081A400000000000000000000000167E44185000000B3000000000000000000000000000000000000004100000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/.editorconfigroot = true
[*.{py,rst,txt}]
indent_style = space
trim_trailing_whitespace = true
indent_size = 4
end_of_line = LF
[*.yml]
indent_style = space
indent_size = 2
end_of_line = LF
07070100000001000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000003B00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/.github07070100000002000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000004500000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/.github/workflows07070100000003000081A400000000000000000000000167E44185000002CF000000000000000000000000000000000000005100000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/.github/workflows/runtime.yml# Runtime tests
name: Runtime
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
test:
name: Runtime
runs-on: ubuntu-latest
container: python:3.13-alpine3.21
steps:
- name: Install Alpine Dependencies
run: apk add cmake git make
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Display CMake version
run: cmake --version
- name: Display Git version
run: git --version
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Dependencies
run: pip install -e .
- name: Test
run: cmake . && ctest -VV .
07070100000004000081A400000000000000000000000167E4418500000070000000000000000000000000000000000000003E00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/.gitignore*.py[co]
*\$py.class
*.egg-info
dist
build
/Testing
/Makefile
/tests/Makefile
*.cmake
CMakeFiles
CMakeCache.txt
07070100000005000081A400000000000000000000000167E4418500000064000000000000000000000000000000000000003F00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/.gitmodules[submodule "tests"]
path = tests
url = https://github.com/editorconfig/editorconfig-core-test.git
07070100000006000081A400000000000000000000000167E4418500000157000000000000000000000000000000000000003F00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/.travis.ymllanguage: python
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "pypy"
# test script
before_script:
- cmake .
script:
- export PYTHONPATH=$(pwd)
- ctest -VV --output-on-failure .
addons:
apt:
packages:
- cmake
# Notify the mailing list
notifications:
email:
on_success: change
on_failure: always
07070100000007000081A400000000000000000000000167E4418500000230000000000000000000000000000000000000004200000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/CMakeLists.txt# This file is used for testing only
# To perform the test, run `cmake .` at the root of the project tree followed
# by ctest .
cmake_minimum_required(VERSION 3.16.3)
# Do not check any compiler
project(editorconfig-core-py NONE)
find_package(PythonInterp)
if(NOT PYTHONINTERP_FOUND)
message(FATAL_ERROR
"Python interpreter is not found. If you have python installed, please run:
cmake -DPYTHON_EXECUTABLE=/path/to/python .")
endif()
enable_testing()
set(EDITORCONFIG_CMD ${PYTHON_EXECUTABLE} -m editorconfig)
add_subdirectory(tests)
07070100000008000081A400000000000000000000000167E4418500000232000000000000000000000000000000000000003B00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/COPYINGCopyright (c) 2011-2018 EditorConfig Team, including Hong Xu and Trey Hunner
editorconfig-core-py is free software. You are free to copy,
modify, and/or redistribute this work under the terms of the BSD
2-clause license. See the file "LICENSE.BSD" for details.
Parts of this work – the files "fnmatch.py" and "ini.py" -
are derived from work with copyright held by the Python Software
Foundation. You are free to copy, modify, and/or redistribute
those parts under the terms of the Python Software Foundation
license. See the file "LICENSE.PSF" for details.
07070100000009000081A400000000000000000000000167E441850000052A000000000000000000000000000000000000003F00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/LICENSE.BSDCopyright (c) 2011-2018 EditorConfig Team, including Hong Xu and Trey Hunner
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
0707010000000A000081A400000000000000000000000167E4418500002674000000000000000000000000000000000000003F00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/LICENSE.PSFPYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Python Software Foundation; All Rights Reserved" are retained in Python alone or
in any derivative version prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
-------------------------------------------
BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
Individual or Organization ("Licensee") accessing and otherwise using
this software in source or binary form and its associated
documentation ("the Software").
2. Subject to the terms and conditions of this BeOpen Python License
Agreement, BeOpen hereby grants Licensee a non-exclusive,
royalty-free, world-wide license to reproduce, analyze, test, perform
and/or display publicly, prepare derivative works, distribute, and
otherwise use the Software alone or in any derivative version,
provided, however, that the BeOpen Python License is retained in the
Software, alone or in any derivative version prepared by Licensee.
3. BeOpen is making the Software available to Licensee on an "AS IS"
basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
5. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
6. This License Agreement shall be governed by and interpreted in all
respects by the law of the State of California, excluding conflict of
law provisions. Nothing in this License Agreement shall be deemed to
create any relationship of agency, partnership, or joint venture
between BeOpen and Licensee. This License Agreement does not grant
permission to use BeOpen trademarks or trade names in a trademark
sense to endorse or promote products or services of Licensee, or any
third party. As an exception, the "BeOpen Python" logos available at
http://www.pythonlabs.com/logos.html may be used according to the
permissions granted on that web page.
7. By copying, installing or otherwise using the software, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
---------------------------------------
1. This LICENSE AGREEMENT is between the Corporation for National
Research Initiatives, having an office at 1895 Preston White Drive,
Reston, VA 20191 ("CNRI"), and the Individual or Organization
("Licensee") accessing and otherwise using Python 1.6.1 software in
source or binary form and its associated documentation.
2. Subject to the terms and conditions of this License Agreement, CNRI
hereby grants Licensee a nonexclusive, royalty-free, world-wide
license to reproduce, analyze, test, perform and/or display publicly,
prepare derivative works, distribute, and otherwise use Python 1.6.1
alone or in any derivative version, provided, however, that CNRI's
License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
1995-2001 Corporation for National Research Initiatives; All Rights
Reserved" are retained in Python 1.6.1 alone or in any derivative
version prepared by Licensee. Alternately, in lieu of CNRI's License
Agreement, Licensee may substitute the following text (omitting the
quotes): "Python 1.6.1 is made available subject to the terms and
conditions in CNRI's License Agreement. This Agreement together with
Python 1.6.1 may be located on the Internet using the following
unique, persistent identifier (known as a handle): 1895.22/1013. This
Agreement may also be obtained from a proxy server on the Internet
using the following URL: http://hdl.handle.net/1895.22/1013".
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python 1.6.1 or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python 1.6.1.
4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. This License Agreement shall be governed by the federal
intellectual property law of the United States, including without
limitation the federal copyright law, and, to the extent such
U.S. federal law does not apply, by the law of the Commonwealth of
Virginia, excluding Virginia's conflict of law provisions.
Notwithstanding the foregoing, with regard to derivative works based
on Python 1.6.1 that incorporate non-separable material that was
previously distributed under the GNU General Public License (GPL), the
law of the Commonwealth of Virginia shall govern this License
Agreement only as to issues arising under or with respect to
Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
License Agreement shall be deemed to create any relationship of
agency, partnership, or joint venture between CNRI and Licensee. This
License Agreement does not grant permission to use CNRI trademarks or
trade name in a trademark sense to endorse or promote products or
services of Licensee, or any third party.
8. By clicking on the "ACCEPT" button where indicated, or by copying,
installing or otherwise using Python 1.6.1, Licensee agrees to be
bound by the terms and conditions of this License Agreement.
ACCEPT
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
--------------------------------------------------
Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
The Netherlands. All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0707010000000B000081A400000000000000000000000167E4418500000033000000000000000000000000000000000000003F00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/MANIFEST.ininclude COPYING README.rst LICENSE.BSD LICENSE.PSF
0707010000000C000081A400000000000000000000000167E4418500000AEF000000000000000000000000000000000000003E00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/README.rst========================
EditorConfig Python Core
========================
.. image:: https://img.shields.io/pypi/v/EditorConfig.svg
:target: https://pypi.python.org/pypi/EditorConfig
.. image:: https://img.shields.io/pypi/wheel/EditorConfig.svg
:target: https://pypi.python.org/pypi/EditorConfig
.. image:: https://img.shields.io/pypi/pyversions/EditorConfig.svg
:target: https://pypi.python.org/pypi/EditorConfig
.. image:: https://secure.travis-ci.org/editorconfig/editorconfig-core-py.svg?branch=master
:target: http://travis-ci.org/editorconfig/editorconfig-core-py
EditorConfig Python Core provides the same functionality as the
`EditorConfig C Core <https://github.com/editorconfig/editorconfig-core>`_.
EditorConfig Python core can be used as a command line program or as an
importable library.
EditorConfig Project
====================
EditorConfig makes it easy to maintain the correct coding style when switching
between different text editors and between different projects. The
EditorConfig project maintains a file format and plugins for various text
editors which allow this file format to be read and used by those editors. For
information on the file format and supported text editors, see the
`EditorConfig website <http://editorconfig.org>`_.
Installation
============
With setuptools::
sudo python setup.py install
Getting Help
============
For help with the EditorConfig core code, please write to our `mailing list
<http://groups.google.com/group/editorconfig>`_. Bugs and feature requests
should be submitted to our `issue tracker
<https://github.com/editorconfig/editorconfig/issues>`_.
If you are writing a plugin a language that can import Python libraries, you
may want to import and use the EditorConfig Python Core directly.
Using as a Library
==================
Basic example use of EditorConfig Python Core as a library:
.. code-block:: python
from editorconfig import get_properties, EditorConfigError
filename = "/home/zoidberg/humans/anatomy.md"
try:
options = get_properties(filename)
except EditorConfigError:
print("Error occurred while getting EditorConfig properties")
else:
for key, value in options.items():
print(f"{key}={value}")
For details, please take a look at the `online documentation
<http://pydocs.editorconfig.org>`_.
Running Test Cases
==================
`Cmake <http://www.cmake.org>`_ has to be installed first. Run the test cases
using the following commands::
export PYTHONPATH=$(pwd)
cmake .
ctest .
Use ``-DPYTHON_EXECUTABLE`` to run the tests using an alternative versions of
Python (e.g. Python 3.12)::
cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.12 .
ctest .
License
=======
See COPYING file for licensing details.
0707010000000D000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000003800000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/docs0707010000000E000081A400000000000000000000000167E4418500001231000000000000000000000000000000000000004100000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/docs/Makefile# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/EditorConfigPythonCore.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/EditorConfigPythonCore.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/EditorConfigPythonCore"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/EditorConfigPythonCore"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
0707010000000F000081A400000000000000000000000167E441850000027F000000000000000000000000000000000000004F00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/docs/command_line_usage.rst==================
Command Line Usage
==================
The EditorConfig Python Core can be used from the command line in the same way
as the EditorConfig C Core.
Discovering EditorConfig properties
-----------------------------------
Installing EditorConfig Python Core should add an ``editorconfig.py`` command
to your path. This command can be used to locate and parse EditorConfig files
for a given full filepath. For example::
editorconfig.py /home/zoidberg/humans/anatomy.md
When used to retrieve EditorConfig file properties, ``editorconfig.py`` will
return discovered properties in *key=value* pairs, one on each line.
07070100000010000081A400000000000000000000000167E4418500001C1C000000000000000000000000000000000000004000000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/docs/conf.py# -*- coding: utf-8 -*-
#
# EditorConfig Python Core documentation build configuration file, created by
# sphinx-quickstart on Sat May 5 09:51:42 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
import editorconfig
from editorconfig import __version__
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'EditorConfig Python Core'
copyright = u'2012, EditorConfig Team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = __version__
# The full version, including alpha/beta/rc tags.
release = __version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'agogo'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'EditorConfigPythonCoredoc'
# -- Options for LaTeX output --------------------------------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'EditorConfigPythonCore.tex', u'EditorConfig Python Core Documentation',
u'EditorConfig Team', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'editorconfigpythoncore', u'EditorConfig Python Core Documentation',
[u'EditorConfig Team'], 1)
]
07070100000011000081A400000000000000000000000167E4418500000307000000000000000000000000000000000000004200000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/docs/index.rst==================================================================
EditorConfig Python Core -- Process EditorConfig Files With Python
==================================================================
EditorConfig is a file format for defining file-specific coding styles and a
set of plugins that allow text editors and IDEs to read this file format. For
more information on the EditorConfig project visit the
`EditorConfig Homepage`_.
The EditorConfig Python Core is a Python package for locating and parsing
EditorConfig files. This package can be used as an import by other Python code
or as a stand-alone command line program.
.. _`EditorConfig Homepage`: http://editorconfig.org
Contents:
.. toctree::
:maxdepth: 1
usage
command_line_usage
plugins
07070100000012000081A400000000000000000000000167E44185000011BF000000000000000000000000000000000000004100000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/docs/make.bat@ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. changes to make an overview over all changed/added/deprecated items
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\EditorConfigPythonCore.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\EditorConfigPythonCore.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
:end
07070100000013000081A400000000000000000000000167E4418500000BB9000000000000000000000000000000000000004400000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/docs/plugins.rst===============
Writing Plugins
===============
The EditorConfig Python Core can be easily used by text editor plugins written in Python or plugins that can call an external Python interpreter. The EditorConfig Python Core supports Python versions 2.2 to 2.7. Check out the `Vim`_ and `Gedit`_ plugins for example usages of the EditorConfig Python Core.
.. _`Vim`: https://github.com/editorconfig/editorconfig-vim
.. _`Gedit`: https://github.com/editorconfig/editorconfig-gedit
Use as a library
----------------
For instructions on using the EditorConfig Python Core as a Python library see :doc:`usage`.
Using with an external Python interpreter
-----------------------------------------
The EditorConfig Python Core can be used with an external Python interpreter by executing the ``main.py`` file. The ``main.py`` file can be executed like so::
python editorconfig-core-py/main.py /home/zoidberg/humans/anatomy.md
For more information on command line usage of the EditorConfig Python Core see :doc:`command_line_usage`.
Bundling EditorConfig Python Core with Plugin
---------------------------------------------
A text editor or IDE plugin will either need to bundle the EditorConfig Python
Core with the plugin installation package or the will need to assist the user
in installing the EditorConfig Python Core. Below are instructions for
bundling the EditorConfig Python Core with plugins.
Bundling as a Submodule in Git
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Git submodules allow one repository to be included inside another. A submodule
stores a remote repositry and commit to use for fetching the embedded
repository. Submodules take up very little space in the repository since they
do not actually include the code of the embedded repository directly.
To add EditorConfig Python Core as a submodule in the ``editorconfig-core-py``
directory of your repository::
git submodule add git://github.com/editorconfig/editorconfig-core-py.git editorconfig-core-py
Then every time the code is checked out the submodule directory should be
initialized and updated::
git submodule update --init
Bundling as a Subtree in Git
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Git subtrees are convenient because, unlike submodules, they do not require any
extra work to be performed when cloning the git repository. Git subtrees
include one git codebase as a subdirectory of another.
Example of using a subtree for the ``editorconfig`` directory from the
EditorConfig Python Core repository::
git remote add -f editorconfig-core-py git://github.com/editorconfig/editorconfig-core-py.git
git merge -s ours --no-commit editorconfig-core-py/master
git read-tree --prefix=editorconfig -u editorconfig-core-py/master:editorconfig
git commit
For more information on subtrees consult the `subtree merge guide`_ on Github
and `Chapter 6.7`_ in the book Pro Git.
.. _`subtree merge guide`: http://help.github.com/subtree-merge/
.. _`Chapter 6.7`: http://git-scm.com/book/ch6-7.html
07070100000014000081A400000000000000000000000167E44185000009FF000000000000000000000000000000000000004200000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/docs/usage.rst=====
Usage
=====
Installation
------------
First you will need to install the EditorConfig Python Core package.
To install from PyPI using pip::
pip install editorconfig
Discovering EditorConfig properties
-----------------------------------
The ``get_properties`` function can be used to discover EditorConfig properties
for a given file. Example:
.. code-block:: python
import logging
from editorconfig import get_properties, EditorConfigError
filename = "/home/zoidberg/humans/anatomy.md"
try:
options = get_properties(filename)
except EditorConfigError:
logging.warning("Error getting EditorConfig properties", exc_info=True)
else:
for key, value in options.items():
print "%s=%s" % (key, value)
The ``get_properties`` method returns a dictionary representing EditorConfig
properties found for the given file. If an error occurs while parsing a file
an exception will be raised. All raised exceptions will inherit from the
``EditorConfigError`` class.
Handling Exceptions
-------------------
All exceptions raised by EditorConfig will subclass ``EditorConfigError``. To
handle certain exceptions specially, catch them first. More exception classes
may be added in the future so it is advisable to always handle general
``EditorConfigError`` exceptions in case a future version raises an exception
that your code does not handle specifically.
Exceptions module reference
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Exceptions can be found in the ``editorconfig.exceptions`` module. These are
the current exception types:
.. autoexception:: editorconfig.exceptions.EditorConfigError
.. autoexception:: editorconfig.exceptions.ParsingError
.. autoexception:: editorconfig.exceptions.PathError
.. autoexception:: editorconfig.exceptions.VersionError
Exception handling example
~~~~~~~~~~~~~~~~~~~~~~~~~~
An example of custom exception handling:
.. code-block:: python
import logging
from editorconfig import get_properties
from editorconfig import exceptions
filename = "/home/zoidberg/myfile.txt"
try:
options = get_properties(filename)
except exceptions.ParsingError:
logging.warning("Error parsing an .editorconfig file", exc_info=True)
except exceptions.PathError:
logging.error("Invalid filename specified", exc_info=True)
except exceptions.EditorConfigError:
logging.error("An unknown EditorConfig error occurred", exc_info=True)
for key, value in options.iteritems():
print "%s=%s" % (key, value)
07070100000015000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000004000000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/editorconfig07070100000016000081A400000000000000000000000167E44185000001F8000000000000000000000000000000000000004C00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/editorconfig/__init__.py"""EditorConfig Python Core"""
from editorconfig.versiontools import join_version
from editorconfig.version import VERSION
__all__ = ['get_properties', 'EditorConfigError', 'exceptions']
__version__ = join_version(VERSION)
def get_properties(filename):
"""Locate and parse EditorConfig files for the given filename"""
handler = EditorConfigHandler(filename)
return handler.get_configurations()
from editorconfig.handler import EditorConfigHandler
from editorconfig.exceptions import *
07070100000017000081A400000000000000000000000167E4418500000977000000000000000000000000000000000000004C00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/editorconfig/__main__.py"""EditorConfig command line interface
Licensed under Simplified BSD License (see LICENSE.BSD file).
"""
import getopt
import sys
from editorconfig import VERSION, __version__
from editorconfig.compat import force_unicode
from editorconfig.exceptions import ParsingError, PathError, VersionError
from editorconfig.handler import EditorConfigHandler
from editorconfig.versiontools import split_version
def version():
print("EditorConfig Python Core Version %s" % __version__)
def usage(command, error=False):
if error:
out = sys.stderr
else:
out = sys.stdout
out.write("%s [OPTIONS] FILENAME\n" % command)
out.write('-f '
'Specify conf filename other than ".editorconfig".\n')
out.write("-b "
"Specify version (used by devs to test compatibility).\n")
out.write("-h OR --help Print this help message.\n")
out.write("-v OR --version Display version information.\n")
def main():
command_name = sys.argv[0]
try:
opts, args = getopt.getopt(list(map(force_unicode, sys.argv[1:])),
"vhb:f:", ["version", "help"])
except getopt.GetoptError as e:
print(str(e))
usage(command_name, error=True)
sys.exit(2)
version_tuple = VERSION
conf_filename = '.editorconfig'
for option, arg in opts:
if option in ('-h', '--help'):
usage(command_name)
sys.exit()
if option in ('-v', '--version'):
version()
sys.exit()
if option == '-f':
conf_filename = arg
if option == '-b':
version_tuple = split_version(arg)
if version_tuple is None:
sys.exit("Invalid version number: %s" % arg)
if len(args) < 1:
usage(command_name, error=True)
sys.exit(2)
filenames = args
multiple_files = len(args) > 1
for filename in filenames:
handler = EditorConfigHandler(filename, conf_filename, version_tuple)
try:
options = handler.get_configurations()
except (ParsingError, PathError, VersionError) as e:
print(str(e))
sys.exit(2)
if multiple_files:
print("[%s]" % filename)
for key, value in options.items():
print("%s=%s" % (key, value))
if __name__ == "__main__":
main()
07070100000018000081A400000000000000000000000167E44185000001C8000000000000000000000000000000000000004A00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/editorconfig/compat.py"""EditorConfig Python2/Python3 compatibility utilities"""
import sys
__all__ = ['force_unicode', 'u']
if sys.version_info[0] == 2:
text_type = unicode
else:
text_type = str
def force_unicode(string):
if not isinstance(string, text_type):
string = text_type(string, encoding='utf-8')
return string
if sys.version_info[0] == 2:
import codecs
u = lambda s: codecs.unicode_escape_decode(s)[0]
else:
u = lambda s: s
07070100000019000081A400000000000000000000000167E44185000002A9000000000000000000000000000000000000004E00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/editorconfig/exceptions.py"""EditorConfig exception classes
Licensed under Simplified BSD License (see LICENSE.BSD file).
"""
class EditorConfigError(Exception):
"""Parent class of all exceptions raised by EditorConfig"""
try:
from ConfigParser import ParsingError as _ParsingError
except:
from configparser import ParsingError as _ParsingError
class ParsingError(_ParsingError, EditorConfigError):
"""Error raised if an EditorConfig file could not be parsed"""
class PathError(ValueError, EditorConfigError):
"""Error raised if invalid filepath is specified"""
class VersionError(ValueError, EditorConfigError):
"""Error raised if invalid version number is specified"""
0707010000001A000081A400000000000000000000000167E4418500001AA3000000000000000000000000000000000000004B00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/editorconfig/fnmatch.py"""Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function translate(PATTERN) returns a regular expression
corresponding to PATTERN. (It does not compile it.)
Based on code from fnmatch.py file distributed with Python 2.6.
Licensed under PSF License (see LICENSE.PSF file).
Changes to original fnmatch module:
- translate function supports ``*`` and ``**`` similarly to fnmatch C library
"""
import os
import re
__all__ = ["fnmatch", "fnmatchcase", "translate"]
_cache = {}
LEFT_BRACE = re.compile(
r"""
(?<! \\ ) # Not preceded by "\"
\{ # "{"
""", re.VERBOSE
)
RIGHT_BRACE = re.compile(
r"""
(?<! \\ ) # Not preceded by "\"
\} # "}"
""", re.VERBOSE
)
NUMERIC_RANGE = re.compile(
r"""
( # Capture a number
[+-] ? # Zero or one "+" or "-" characters
\d + # One or more digits
)
\.\. # ".."
( # Capture a number
[+-] ? # Zero or one "+" or "-" characters
\d + # One or more digits
)
""", re.VERBOSE
)
def fnmatch(name, pat):
"""Test whether FILENAME matches PATTERN.
Patterns are Unix shell style:
- ``*`` matches everything except path separator
- ``**`` matches everything
- ``?`` matches any single character
- ``[seq]`` matches any character in seq
- ``[!seq]`` matches any char not in seq
- ``{s1,s2,s3}`` matches any of the strings given (separated by commas)
An initial period in FILENAME is not special.
Both FILENAME and PATTERN are first case-normalized
if the operating system requires it.
If you don't want this, use fnmatchcase(FILENAME, PATTERN).
"""
name = os.path.normpath(name).replace(os.sep, "/")
return fnmatchcase(name, pat)
def cached_translate(pat):
if not pat in _cache:
res, num_groups = translate(pat)
regex = re.compile(res)
_cache[pat] = regex, num_groups
return _cache[pat]
def fnmatchcase(name, pat):
"""Test whether FILENAME matches PATTERN, including case.
This is a version of fnmatch() which doesn't case-normalize
its arguments.
"""
regex, num_groups = cached_translate(pat)
match = regex.match(name)
if not match:
return False
pattern_matched = True
for (num, (min_num, max_num)) in zip(match.groups(), num_groups):
if num[0] == '0' or not (min_num <= int(num) <= max_num):
pattern_matched = False
break
return pattern_matched
def translate(pat, nested=False):
"""Translate a shell PATTERN to a regular expression.
There is no way to quote meta-characters.
"""
index, length = 0, len(pat) # Current index and length of pattern
brace_level = 0
in_brackets = False
result = ''
is_escaped = False
matching_braces = (len(LEFT_BRACE.findall(pat)) ==
len(RIGHT_BRACE.findall(pat)))
numeric_groups = []
while index < length:
current_char = pat[index]
index += 1
if current_char == '*':
pos = index
if pos < length and pat[pos] == '*':
result += '.*'
else:
result += '[^/]*'
elif current_char == '?':
result += '[^/]'
elif current_char == '[':
if in_brackets:
result += '\\['
else:
pos = index
has_slash = False
while pos < length and pat[pos] != ']':
if pat[pos] == '/' and pat[pos-1] != '\\':
has_slash = True
break
pos += 1
if has_slash:
result += '\\[' + pat[index:(pos + 1)]
index = pos + 1
else:
if index < length and pat[index] in '!^':
index += 1
result += '[^'
else:
result += '['
in_brackets = True
elif current_char == '-':
if in_brackets:
result += current_char
else:
result += '\\' + current_char
elif current_char == ']':
if in_brackets and pat[index-2] == '\\':
result += '\\]'
else:
result += current_char
in_brackets = False
elif current_char == '{':
pos = index
has_comma = False
while pos < length and (pat[pos] != '}' or is_escaped):
if pat[pos] == ',' and not is_escaped:
has_comma = True
break
is_escaped = pat[pos] == '\\' and not is_escaped
pos += 1
if not has_comma and pos < length:
num_range = NUMERIC_RANGE.match(pat[index:pos])
if num_range:
numeric_groups.append(map(int, num_range.groups()))
result += r"([+-]?\d+)"
else:
inner_result, inner_groups = translate(pat[index:pos],
nested=True)
result += '\\{%s\\}' % (inner_result,)
numeric_groups += inner_groups
index = pos + 1
elif matching_braces:
result += '(?:'
brace_level += 1
else:
result += '\\{'
elif current_char == ',':
if brace_level > 0 and not is_escaped:
result += '|'
else:
result += '\\,'
elif current_char == '}':
if brace_level > 0 and not is_escaped:
result += ')'
brace_level -= 1
else:
result += '\\}'
elif current_char == '/':
if pat[index:(index + 3)] == "**/":
result += "(?:/|/.*/)"
index += 3
else:
result += '/'
elif current_char != '\\':
result += re.escape(current_char)
if current_char == '\\':
if is_escaped:
result += re.escape(current_char)
is_escaped = not is_escaped
else:
is_escaped = False
if not nested:
result = r'(?s)%s\Z' % result
return result, numeric_groups
0707010000001B000081A400000000000000000000000167E44185000010CA000000000000000000000000000000000000004B00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/editorconfig/handler.py"""EditorConfig file handler
Provides ``EditorConfigHandler`` class for locating and parsing
EditorConfig files relevant to a given filepath.
Licensed under Simplified BSD License (see LICENSE.BSD file).
"""
import os
from editorconfig import VERSION
from editorconfig.exceptions import PathError, VersionError
from editorconfig.ini import EditorConfigParser
__all__ = ['EditorConfigHandler']
def get_filenames(path, filename):
"""Yield full filepath for filename in each directory in and above path"""
path_list = []
while True:
path_list.append(os.path.join(path, filename))
newpath = os.path.dirname(path)
if path == newpath:
break
path = newpath
return path_list
class EditorConfigHandler(object):
"""
Allows locating and parsing of EditorConfig files for given filename
In addition to the constructor a single public method is provided,
``get_configurations`` which returns the EditorConfig options for
the ``filepath`` specified to the constructor.
"""
def __init__(self, filepath, conf_filename='.editorconfig',
version=VERSION):
"""Create EditorConfigHandler for matching given filepath"""
self.filepath = filepath
self.conf_filename = conf_filename
self.version = version
self.options = None
def get_configurations(self):
"""
Find EditorConfig files and return all options matching filepath
Special exceptions that may be raised by this function include:
- ``VersionError``: self.version is invalid EditorConfig version
- ``PathError``: self.filepath is not a valid absolute filepath
- ``ParsingError``: improperly formatted EditorConfig file found
"""
self.check_assertions()
path, filename = os.path.split(self.filepath)
conf_files = get_filenames(path, self.conf_filename)
# Attempt to find and parse every EditorConfig file in filetree
for filename in conf_files:
parser = EditorConfigParser(self.filepath)
parser.read(filename)
# Merge new EditorConfig file's options into current options
old_options = self.options
self.options = parser.options
if old_options:
self.options.update(old_options)
# Stop parsing if parsed file has a ``root = true`` option
if parser.root_file:
break
self.preprocess_values()
return self.options
def check_assertions(self):
"""Raise error if filepath or version have invalid values"""
# Raise ``PathError`` if filepath isn't an absolute path
if not os.path.isabs(self.filepath):
raise PathError("Input file must be a full path name.")
# Raise ``VersionError`` if version specified is greater than current
if self.version is not None and self.version[:3] > VERSION[:3]:
raise VersionError(
"Required version is greater than the current version.")
def preprocess_values(self):
"""Preprocess option values for consumption by plugins"""
opts = self.options
# Lowercase option value for certain options
for name in ["end_of_line", "indent_style", "indent_size",
"insert_final_newline", "trim_trailing_whitespace",
"charset"]:
if name in opts:
opts[name] = opts[name].lower()
# Set indent_size to "tab" if indent_size is unspecified and
# indent_style is set to "tab".
if (opts.get("indent_style") == "tab" and
not "indent_size" in opts and self.version >= (0, 10, 0)):
opts["indent_size"] = "tab"
# Set tab_width to indent_size if indent_size is specified and
# tab_width is unspecified
if ("indent_size" in opts and "tab_width" not in opts and
opts["indent_size"] != "tab"):
opts["tab_width"] = opts["indent_size"]
# Set indent_size to tab_width if indent_size is "tab"
if ("indent_size" in opts and "tab_width" in opts and
opts["indent_size"] == "tab"):
opts["indent_size"] = opts["tab_width"]
0707010000001C000081A400000000000000000000000167E4418500001931000000000000000000000000000000000000004700000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/editorconfig/ini.py"""EditorConfig file parser
Based on code from ConfigParser.py file distributed with Python 2.6.
Licensed under PSF License (see LICENSE.PSF file).
Changes to original ConfigParser:
- Special characters can be used in section names
- Octothorpe can be used for comments (not just at beginning of line)
- Only track INI options in sections that match target filename
- Stop parsing files with when ``root = true`` is found
"""
import posixpath
import re
from codecs import open
from collections import OrderedDict
from os import sep
from os.path import dirname, normpath
from editorconfig.compat import u
from editorconfig.exceptions import ParsingError
from editorconfig.fnmatch import fnmatch
__all__ = ["ParsingError", "EditorConfigParser"]
class EditorConfigParser(object):
"""Parser for EditorConfig-style configuration files
Based on RawConfigParser from ConfigParser.py in Python 2.6.
"""
# Regular expressions for parsing section headers and options.
# Allow ``]`` and escaped ``;`` and ``#`` characters in section headers
SECTCRE = re.compile(
r"""
\s * # Optional whitespace
\[ # Opening square brace
(?P<header> # One or more characters excluding
( [^\#;] | \\\# | \\; ) + # unescaped # and ; characters
)
\] # Closing square brace
""", re.VERBOSE
)
# Regular expression for parsing option name/values.
# Allow any amount of whitespaces, followed by separator
# (either ``:`` or ``=``), followed by any amount of whitespace and then
# any characters to eol
OPTCRE = re.compile(
r"""
\s * # Optional whitespace
(?P<option> # One or more characters excluding
[^:=\s] # : a = characters (and first
[^:=] * # must not be whitespace)
)
\s * # Optional whitespace
(?P<vi>
[:=] # Single = or : character
)
\s * # Optional whitespace
(?P<value>
. * # One or more characters
)
$
""", re.VERBOSE
)
def __init__(self, filename):
self.filename = filename
self.options = OrderedDict()
self.root_file = False
def matches_filename(self, config_filename, glob):
"""Return True if section glob matches filename"""
config_dirname = normpath(dirname(config_filename)).replace(sep, '/')
glob = glob.replace("\\#", "#")
glob = glob.replace("\\;", ";")
if '/' in glob:
if glob.find('/') == 0:
glob = glob[1:]
glob = posixpath.join(config_dirname, glob)
else:
glob = posixpath.join('**/', glob)
return fnmatch(self.filename, glob)
def read(self, filename):
"""Read and parse single EditorConfig file"""
try:
fp = open(filename, encoding='utf-8')
except IOError:
return
self._read(fp, filename)
fp.close()
def _read(self, fp, fpname):
"""Parse a sectioned setup file.
The sections in setup file contains a title line at the top,
indicated by a name in square brackets (`[]'), plus key/value
options lines, indicated by `name: value' format lines.
Continuations are represented by an embedded newline then
leading whitespace. Blank lines, lines beginning with a '#',
and just about everything else are ignored.
"""
in_section = False
matching_section = False
optname = None
lineno = 0
e = None # None, or an exception
while True:
line = fp.readline()
if not line:
break
if lineno == 0 and line.startswith(u('\ufeff')):
line = line[1:] # Strip UTF-8 BOM
lineno = lineno + 1
# comment or blank line?
if line.strip() == '' or line[0] in '#;':
continue
# a section header or option header?
else:
# is it a section header?
mo = self.SECTCRE.match(line)
if mo:
sectname = mo.group('header')
in_section = True
matching_section = self.matches_filename(fpname, sectname)
# So sections can't start with a continuation line
optname = None
# an option line?
else:
mo = self.OPTCRE.match(line)
if mo:
optname, vi, optval = mo.group('option', 'vi', 'value')
if ';' in optval or '#' in optval:
# ';' and '#' are comment delimiters only if
# preceeded by a spacing character
m = re.search('(.*?) [;#]', optval)
if m:
optval = m.group(1)
optval = optval.strip()
# allow empty values
if optval == '""':
optval = ''
optname = self.optionxform(optname.rstrip())
if not in_section and optname == 'root':
self.root_file = (optval.lower() == 'true')
if matching_section:
self.options[optname] = optval
else:
# a non-fatal parsing error occurred. set up the
# exception but keep going. the exception will be
# raised at the end of the file and will contain a
# list of all bogus lines
if not e:
e = ParsingError(fpname)
e.append(lineno, repr(line))
# if any parsing errors occurred, raise an exception
if e:
raise e
def optionxform(self, optionstr):
return optionstr.lower()
0707010000001D000081A400000000000000000000000167E441850000001E000000000000000000000000000000000000004B00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/editorconfig/version.pyVERSION = (0, 17, 0, "final")
0707010000001E000081A400000000000000000000000167E44185000003CD000000000000000000000000000000000000005000000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/editorconfig/versiontools.py"""EditorConfig version tools
Provides ``join_version`` and ``split_version`` classes for converting
__version__ strings to VERSION tuples and vice versa.
"""
import re
__all__ = ['join_version', 'split_version']
_version_re = re.compile(r'^(\d+)\.(\d+)\.(\d+)(\..*)?$', re.VERBOSE)
def join_version(version_tuple):
"""Return a string representation of version from given VERSION tuple"""
version = "%s.%s.%s" % version_tuple[:3]
if version_tuple[3] != "final":
version += "-%s" % version_tuple[3]
return version
def split_version(version):
"""Return VERSION tuple for given string representation of version"""
match = _version_re.search(version)
if not match:
return None
else:
split_version = list(match.groups())
if split_version[3] is None:
split_version[3] = "final"
split_version = list(map(int, split_version[:3])) + split_version[3:]
return tuple(split_version)
0707010000001F000081A400000000000000000000000167E441850000047E000000000000000000000000000000000000004200000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/pyproject.toml[build-system]
requires = ["setuptools>=78.1.0"]
build-backend = "setuptools.build_meta"
[project]
name = "EditorConfig"
authors = [{name = "EditorConfig Team"}]
license = {text = "PSF-2.0"}
description = "EditorConfig File Locator and Interpreter for Python"
readme = "README.rst"
classifiers = [
"License :: OSI Approved :: Python Software Foundation License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: PyPy",
]
dynamic = ["version"]
[project.urls]
Homepage = "https://editorconfig.org/"
"Source Code" = "https://github.com/editorconfig/editorconfig-core-py"
"Bug Tracker" = "https://github.com/editorconfig/editorconfig-core-py/issues"
[project.scripts]
editorconfig = "editorconfig.__main__:main"
[tool.setuptools]
packages = ["editorconfig"]
include-package-data = false
07070100000020000081A400000000000000000000000167E44185000000E9000000000000000000000000000000000000004100000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/renovate.json{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended", "group:allNonMajor"],
"rangeStrategy": "bump",
"git-submodules": {
"enabled": true
},
"schedule": ["on Wednesday"]
}
07070100000021000081A400000000000000000000000167E441850000014C000000000000000000000000000000000000003C00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/setup.pyimport os
from setuptools import setup
# Read the version
g = {}
with open(os.path.join("editorconfig", "version.py"), "rt") as fp:
exec(fp.read(), g)
v = g['VERSION']
version = ".".join(str(x) for x in v[:3])
if v[3] != "final":
version += "-" + v[3]
if __name__ == "__main__":
setup(version=version)
07070100000022000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000003900000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests07070100000023000081A400000000000000000000000167E44185000000B6000000000000000000000000000000000000004700000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/.editorconfig[{CMakeLists.txt,*.cmake}]
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
[*.in]
trim_trailing_whitespace = false
[*.md]
indent_style = space
indent_size = 4
07070100000024000081A400000000000000000000000167E44185000000CB000000000000000000000000000000000000004400000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/.gitignore# Generated by CMake
CMakeCache.txt
CMakeFiles
Makefile
cmake_install.cmake
install_manifest.txt
# Generated by CTest
/Testing
CTestTestfile.cmake
# Eclipse
.project
# Editor backup files
~*
*~
*.swp
07070100000025000081A400000000000000000000000167E4418500001612000000000000000000000000000000000000004800000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/CMakeLists.txt#
# Copyright (c) 2011-2018 EditorConfig Team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# New escape-sequence processing.
cmake_minimum_required(VERSION 3.16.3)
cmake_policy(VERSION 3.16.3)
# Don't check any language compiler. This project is for EditorConfig Core
# testing only.
project(editorconfig-core-test NONE)
# Where this file lives
set(tests_cmakelists_dir "${CMAKE_CURRENT_LIST_DIR}")
message(STATUS "Tests are in ${tests_cmakelists_dir}")
# Only when we are using editorconfig-core-test independently should we check
# cmake version, set EDITORCONFIG_CMD as cache string, and enable_testing()
# here.
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
set(EDITORCONFIG_CMD "editorconfig" CACHE STRING "editorconfig command.")
set(EDITORCONFIG_CMD_IS_TARGET OFF CACHE BOOL
"EDITORCONFIG_CMD names a CMake target rather than an executable.")
enable_testing()
message(STATUS "tests: Standalone testing enabled")
endif()
if(${EDITORCONFIG_CMD_IS_TARGET})
message(STATUS "tests: Using editorconfig target ${EDITORCONFIG_CMD}")
else()
message(STATUS "tests: Using editorconfig binary ${EDITORCONFIG_CMD}")
endif()
# The most common test function
function(new_ec_test name ec_file src_file regex)
add_test(NAME ${name} COMMAND ${EDITORCONFIG_CMD} -f ${ec_file}
"${CMAKE_CURRENT_SOURCE_DIR}/${src_file}")
set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "${regex}")
endfunction()
# A test that requires a version specified
function(new_ec_test_version name ec_file src_file regex version)
add_test(NAME ${name} COMMAND ${EDITORCONFIG_CMD} -b ${version} -f ${ec_file}
"${CMAKE_CURRENT_SOURCE_DIR}/${src_file}")
set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "${regex}")
endfunction()
# A test that requires the full path to the EditorConfig files
function(new_ec_test_full_ec_file_path name ec_file src_file regex)
add_test(NAME ${name} COMMAND ${EDITORCONFIG_CMD} -f ${ec_file} ${src_file})
set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "${regex}")
endfunction()
# A test that returns multiple lines of output. CAUTION: filenames used in
# these tests may not contain semicolons.
function(new_ec_test_multiline name ec_file src_file regex)
#message(STATUS "Building multiline test ${name} with tests_cmakelists_dir ${tests_cmakelists_dir}")
#message(STATUS "List dir ${CMAKE_CURRENT_LIST_DIR}, source dir ${CMAKE_CURRENT_SOURCE_DIR}")
if(${EDITORCONFIG_CMD_IS_TARGET})
add_test(NAME ${name} COMMAND "cmake"
"-D" "EDITORCONFIG_CMD=$<TARGET_FILE:${EDITORCONFIG_CMD}>"
# Since variables aren't automatically passed to the inner cmake
"-D" "ECARGS:LIST=-f;${ec_file};${CMAKE_CURRENT_SOURCE_DIR}/${src_file}"
# Note: the semicolons separate list elements.
"-P" "${tests_cmakelists_dir}/cmake/ec_sort.cmake")
else()
add_test(NAME ${name} COMMAND "cmake"
"-D" "EDITORCONFIG_CMD=${EDITORCONFIG_CMD}"
# Since variables aren't automatically passed to the inner cmake
"-D" "ECARGS:LIST=-f;${ec_file};${CMAKE_CURRENT_SOURCE_DIR}/${src_file}"
# Note: the semicolons separate list elements.
"-P" "${tests_cmakelists_dir}/cmake/ec_sort.cmake")
endif()
set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION
"^[\r\n]*${regex}$")
# Permit leading \n's because I can't always get rid of them using
# only CMake-provided facilities.
endfunction()
# Tests for other CLI arguments. Usage:
# new_ec_cli_test(NAME name MATCH pass_regex ARGS arguments...)
function(new_ec_cli_test)
# Parse args
set(one_value_keywords NAME MATCH)
set(multi_value_keywords ARGS)
cmake_parse_arguments(P
"" "${one_value_keywords}" "${multi_value_keywords}" ${ARGN})
# Add test
add_test(NAME ${P_NAME} COMMAND ${EDITORCONFIG_CMD} ${P_ARGS})
set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "${P_MATCH}")
endfunction()
# First, make sure the test harness works.
add_subdirectory(meta)
# Then test the core.
add_subdirectory(glob)
add_subdirectory(properties)
add_subdirectory(parser)
add_subdirectory(filetree)
add_subdirectory(cli)
07070100000026000081A400000000000000000000000167E441850000051D000000000000000000000000000000000000004500000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/LICENSE.txtCopyright (c) 2011-2018 EditorConfig Team
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
07070100000027000081A400000000000000000000000167E44185000004D8000000000000000000000000000000000000004300000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/README.mdThis project is a series of testing for [EditorConfig Core][editorconfig]. Please have
[cmake][] installed before using this project.
### Use editorconfig-core-test independently
After installing cmake, switch to the root dir of this project, and execute:
cmake -DEDITORCONFIG_CMD=the_editorconfig_core_cmd_you_want_to_test .
After that, if testing files are generated successfully, execute `ctest .` to
start testings.
### Use editorconfig-core-test in your project as a git submodule
If you are using [git][] and cmake to manage your project, this method should
be suitable for you.
Suppose that you will add editorconfig-core-test repo as a
submodule in your root directory. First add editorconfig-core-test as a
gitsubmodule in your repo by execute:
git submodule add git://github.com/editorconfig/editorconfig-core-test.git tests
Then add the following lines to your project root `CMakeLists.txt`:
```cmake
enable_testing()
set(EDITORCONFIG_CMD the_editorconfig_core_path)
add_subdirectory(tests)
```
Now after executing `cmake .` in you project root dir, you should be able to
run the testings by executing `ctest .`.
[cmake]: http://www.cmake.org
[editorconfig]: http://editorconfig.org
[git]: http://git-scm.com
07070100000028000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000003D00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/cli07070100000029000081A400000000000000000000000167E44185000009DE000000000000000000000000000000000000004C00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/cli/CMakeLists.txt#
# Copyright (c) 2011-2018 EditorConfig Team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Tests for version switches
# test --version option returns version information
new_ec_cli_test(NAME test_long_version_switch
ARGS --version
MATCH "^EditorConfig.* Version [0-9]+\\.[0-9]+\\.[0-9]+(-[a-z]+)?[ \t\n\r]$")
# test -v option returns version information
new_ec_cli_test(NAME test_short_version_switch
ARGS -v
MATCH "^EditorConfig.* Version [0-9]+\\.[0-9]+\\.[0-9]+(-[a-z]+)?[ \t\n\r]$")
# Test for multiple input files
# when files are specified on command line. The files can appear in either
# order in the output, but each file's output line must be grouped with its
# file header. Handle this by listing both possibilities manually in the regex.
new_ec_cli_test(NAME multiple_files_on_command_line
ARGS -f cli.in
"${CMAKE_CURRENT_SOURCE_DIR}/file1.c"
"${CMAKE_CURRENT_SOURCE_DIR}/file2.cpp"
MATCH
"^(\\[${CMAKE_CURRENT_SOURCE_DIR}/file1.c\\][ \t]*[\n\r]+key1=value1[ \t]*[\n\r]+\\[${CMAKE_CURRENT_SOURCE_DIR}/file2.cpp\\][ \t]*[\n\r]+key2=value2)|(\\[${CMAKE_CURRENT_SOURCE_DIR}/file2.cpp\\][ \t]*[\n\r]+key2=value2[ \t]*[\n\r]+\\[${CMAKE_CURRENT_SOURCE_DIR}/file1.c\\][ \t]*[\n\r]+key1=value1)[ \t\n\r]*$"
)
0707010000002A000081A400000000000000000000000167E4418500000038000000000000000000000000000000000000004400000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/cli/cli.inroot = true
[*.c]
key1 = value1
[*.cpp]
key2 = value2
0707010000002B000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000003F00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/cmake0707010000002C000081ED00000000000000000000000167E4418500000801000000000000000000000000000000000000004F00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/cmake/almostcat.cmake# almostcat.cmake: print the file named in ${WHICH} to **stderr**. Puts an
# extra space at the beginning to suppress CMake's word wrapping. May add
# an extra \n at the end because that's what message() does.
# BSD-2-Clause
# Copyright 2018 Christopher White (cxw42 at GitHub; http://devwrench.com)
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
cmake_minimum_required(VERSION 3.16.3)
if("${WHICH}" STREQUAL "")
message(FATAL_ERROR "No WHICH parameter specified")
return()
endif()
#message(FATAL_ERROR " Reading ${WHICH}") # Uncomment for debugging
file(READ "${WHICH}" contents)
# message() will give us an extra \n, so trim one if we can.
string(REGEX REPLACE "(\r\n|\r|\n)$" "" lines "${lines}")
# Print, with a leading space as noted above.
message(" ${contents}")
0707010000002D000081ED00000000000000000000000167E4418500000B82000000000000000000000000000000000000004D00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/cmake/ec_sort.cmake# ec_sort.cmake: Run editorconfig and sort its output
# For use in editorconfig; see
# https://github.com/editorconfig/editorconfig/issues/375 .
# Call as, e.g.:
# cmake -D EDITORCONFIG_CMD="../editorconfig" -D ECARGS:LIST="-f;.editorconfig;foo" -P cmake/ec_sort.cmake
# EDITORCONFIG_CMD may also be list-valued. EDITORCONFIG_CMD and ECARGS
# are put together on the command line, in that order, and split by CMake.
# BSD-2-Clause
# Copyright 2018 Christopher White (cxw42 at GitHub; http://devwrench.com)
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
cmake_minimum_required(VERSION 3.16.3)
# See documentation links at https://stackoverflow.com/q/12802377/2877364
set(tests_cmake_ec_sort_dir "${CMAKE_CURRENT_LIST_DIR}")
list(APPEND CMAKE_MODULE_PATH "${tests_cmake_ec_sort_dir}/../cmake")
include(runandsort)
# Required parameters are in variables: EDITORCONFIG_CMD and ECARGS
if("${EDITORCONFIG_CMD}" STREQUAL "")
message(FATAL_ERROR "No EDITORCONFIG_CMD parameter specified")
return()
endif()
if("${ECARGS}" STREQUAL "")
message(FATAL_ERROR "No ECARGS parameter specified")
return()
endif()
# Uncomment for debugging
#message(FATAL_ERROR " Running ${EDITORCONFIG_CMD} with ${ECARGS}")
run_and_sort(RETVAL lines RETVAL_FAILURE did_fail
CMDLINE ${EDITORCONFIG_CMD} ${ECARGS}
)
if(${did_fail})
message(FATAL_ERROR "${EDITORCONFIG_CMD} ${ECARGS} returned a nonzero exit code")
return()
endif()
# message() will give us an extra \n, so trim one if we can.
string(REGEX REPLACE "(\r\n|\r|\n)$" "" lines "${lines}")
# Output **to stderr**. If we used message(STATUS...), it would print to
# stdout but also emit a leading "--".
message("${lines}")
0707010000002E000081ED00000000000000000000000167E441850000151A000000000000000000000000000000000000005000000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/cmake/runandsort.cmake# runandsort.cmake: Run a program and sort its output
# For use in editorconfig; see
# https://github.com/editorconfig/editorconfig/issues/375 .
# BSD-2-Clause
# Copyright 2018 Christopher White (cxw42 at GitHub; http://devwrench.com)
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
cmake_minimum_required(VERSION 3.16.3)
# Conventions:
# - "P_*" are parameters parsed using cmake_parse_arguments
# - Any parameter called "RETVAL", "RETVAL_*", or "*_NAME" should be given
# the name of a variable in the caller's scope into which to
# store results.
# Run a program with the given arguments, and return its sorted output as
# a string.
# CAUTION 1: May not produce correct output if any output line includes
# a semicolon, because that is a list separator in CMake.
# CAUTION 2: Depends on sort order of CMake; see discussion at
# https://gitlab.kitware.com/cmake/cmake/issues/18551
#
# Limitations:
# Any \x01 in the string will be corrupted - this routine uses those to work
# around CMake limitations.
# Arguments:
# RETVAL . . . . . . . The name of the variable to store the result in
# CMDLINE . . . . . . . The program to run, and any arguments
# RETVAL_FAILURE . . . . If present, a variable that will be set to TRUE
# if PGM returns a non-zero exit code.
# CAPTURE_STDERR . . . . If present, capture stderr instead of stdout
# TRIM_INITIAL_LEADING_SPACE If present, remove initial spaces from the
# first line. This is to work around a hack
# in almostcat.cmake.
#
# Returns:
# The sorted stdout of PGM, or the FAILURE string if PGM failed.
# PGM's stderr is ignored.
function(run_and_sort)
# Argument parsing
set(option_keywords CAPTURE_STDERR TRIM_INITIAL_LEADING_SPACE)
set(one_value_keywords RETVAL RETVAL_FAILURE)
set(multi_value_keywords CMDLINE ARGS)
cmake_parse_arguments(P "${option_keywords}" "${one_value_keywords}"
"${multi_value_keywords}" ${ARGN})
#message(STATUS "Running ${P_CMDLINE}") # DEBUG
execute_process(COMMAND ${P_CMDLINE}
RESULT_VARIABLE ep_retval
OUTPUT_VARIABLE ep_stdout
ERROR_VARIABLE ep_stderr
)
# Which one are we processing?
if(${P_CAPTURE_STDERR})
set(ep_out "${ep_stderr}")
else()
set(ep_out "${ep_stdout}")
endif()
#message(STATUS "Got retval =${ep_retval}=") # DEBUG
#message(STATUS "Got stdout =${ep_stdout}=") # DEBUG
#message(STATUS "Got stderr =${ep_stderr}=") # DEBUG
# Early bail on failure
if(NOT("${ep_retval}" EQUAL "0"))
set(${P_RETVAL} "" PARENT_SCOPE)
if("${P_RETVAL_FAILURE}" MATCHES ".") # if we got a name
set(${P_RETVAL_FAILURE} TRUE PARENT_SCOPE)
endif()
return()
endif()
# Trim hack
if(${P_TRIM_INITIAL_LEADING_SPACE})
string(REGEX REPLACE "^[ ]+" "" ep_out "${ep_out}")
endif()
# Change all the semicolons in the output to \x01
string(ASCII 1 ONE)
string(REPLACE ";" "${ONE}" ep_out "${ep_out}")
#message(STATUS "After escaping =${ep_out}=") # DEBUG
# Normalize line endings, just in case
string(REGEX REPLACE "\r|\n|\r\n" "\n" ep_out "${ep_out}")
#message(STATUS "After line-endings =${ep_out}=") # DEBUG
# Turn the string into a list
string(REPLACE "\n" ";" ep_out "${ep_out}")
#message(STATUS "After listifying =${ep_out}=") # DEBUG
# Sort the list
list(SORT ep_out)
# Back to individual lines
string(REPLACE ";" "\n" ep_out "${ep_out}")
#message(STATUS "After back to lines =${ep_out}=") # DEBUG
# And back to semicolons. Note: I am not trying to reverse line endings.
string(REPLACE "${ONE}" ";" ep_out "${ep_out}")
#message(STATUS "After unescaping =${ep_out}=") # DEBUG
# Out to the caller
set(${P_RETVAL} "${ep_out}" PARENT_SCOPE)
#message(STATUS "Returned =${ep_out}=") # DEBUG
endfunction(run_and_sort)
0707010000002F000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000004200000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree07070100000030000081A400000000000000000000000167E44185000014C0000000000000000000000000000000000000005100000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/CMakeLists.txt#
# Copyright (c) 2011-2018 EditorConfig Team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Test for EditorConfig file in parent directory
new_ec_test(parent_directory parent_directory.in parent_directory/test.a "^key=value[ \t\n\r]*$")
# Test for EditorConfig file in parent directory and current directory
new_ec_test_multiline(parent_and_current_dir_ML
parent_directory.in parent_directory/test.b
"key1=value1[ \t]*[\n\r]+key2=value2[ \t\n\r]*")
# Test for file in parent directory and overloaded by file in current directory
new_ec_test(parent_dir_overload parent_directory.in parent_directory/test.c "^key=valueB[ \t\n\r]*$")
# Test for file in parent directory and overloaded by file in current directory and repeated in current directory
new_ec_test(parent_dir_overload_repeat parent_directory.in parent_directory/test.d "^key=value_c[ \t\n\r]*$")
# Test for file in parent directory and overloaded by file in current directory and repeated in current directory, with different patterns
new_ec_test(parent_dir_overload_repeat2 parent_directory.in parent_directory/test.e "^key=value_g[ \t\n\r]*$")
# Test that search stops at root EditorConfig file
new_ec_test(root_file root_file.in root_file/test.a "^[ \t\n\r]*$")
# Test that search stops at root EditorConfig file
new_ec_test(root_file_mixed_case root_file.in root_mixed/test.a "^child=true[ \t\n\r]*$")
# Test that search stops at root EditorConfig file
new_ec_test(root_pattern root_file.in root "^name=root[ \t\n\r]*$")
# Tests path separator match
new_ec_test(path_separator path_separator.in path/separator "^key1=value1[ \t\n\r]*$")
# Windows style path separator in the command line should work on Windows, but
# should not work on other systems (including Cygwin)
if(WIN32)
set(path_separator_backslash_in_cmd_line_regex "^key1=value1[ \t\n\r]*$")
else(WIN32)
set(path_separator_backslash_in_cmd_line_regex "^[ \t\n\r]*$")
endif(WIN32)
new_ec_test_full_ec_file_path(path_separator_backslash_in_cmd_line
path_separator.in
"${CMAKE_CURRENT_SOURCE_DIR}\\path\\separator"
${path_separator_backslash_in_cmd_line_regex})
# Tests path separator match below top of path
new_ec_test(nested_path_separator path_separator.in nested/path/separator "^[ \t\n\r]*$")
# Tests path separator match top of path only
new_ec_test(top_level_path_separator path_separator.in top/of/path "^key2=value2[ \t\n\r]*$")
# Tests path separator match top of path only
new_ec_test(top_level_path_separator_neg path_separator.in not/top/of/path "^[ \t\n\r]*$")
# Test Windows-style path separator (backslash) does not work
new_ec_test(windows_separator path_separator.in windows/separator "^[ \t\n\r]*$")
# Test again that Windows-style path separator (backslash) does not work
new_ec_test(windows_separator2 path_separator.in windows/separator2 "^[ \t\n\r]*$")
# Globs with backslash in it but should be considered as file name on Non-Windows system
if((NOT WIN32) AND (NOT CYGWIN))
new_ec_test(backslash_not_on_windows path_separator.in "windows\\separator2" "^key4=value4[ \t\n\r]*$")
endif()
new_ec_test(path_with_special_chars path_with_special_chars.in "path_with_special_[chars/test.a" "^key=value[ \t\n\r]*$")
## " <-- resync the syntax highlighter
# Test the unset value with various common properties
new_ec_test(unset_charset unset.in unset/charset.txt "^charset=unset[ \t\n\r]*$")
new_ec_test(unset_end_of_line unset.in unset/end_of_line.txt "^end_of_line=unset[ \t\n\r]*$")
new_ec_test_multiline(unset_indent_size_ML unset.in unset/indent_size.txt
"indent_size=unset[ \t\n\r]*tab_width=unset[ \t\n\r]*")
new_ec_test(unset_indent_style unset.in unset/indent_style.txt "^indent_style=unset[ \t\n\r]*$")
new_ec_test(unset_insert_final_newline unset.in unset/insert_final_newline.txt "^insert_final_newline=unset[ \t\n\r]*$")
new_ec_test(unset_tab_width unset.in unset/tab_width.txt "^tab_width=unset[ \t\n\r]*$")
new_ec_test(unset_trim_trailing_whitespace unset.in unset/trim_trailing_whitespace.txt "^trim_trailing_whitespace=unset[ \t\n\r]*$")
07070100000031000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000005300000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/parent_directory07070100000032000081A400000000000000000000000167E4418500000077000000000000000000000000000000000000005600000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/parent_directory.inroot = true
[test.a]
key=value
[test.b]
key1=value1
[test.c]
key=valueA
[test.d]
key=value_a
[test.e]
key=value_e
07070100000033000081A400000000000000000000000167E441850000007F000000000000000000000000000000000000006700000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/parent_directory/parent_directory.in[test.b]
key2=value2
[test.c]
key=valueB
[test.d]
key=value_b
[test.d]
key=value_c
[test.e]
key=value_f
[*.e]
key=value_g
07070100000034000081A400000000000000000000000167E44185000000A3000000000000000000000000000000000000005400000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/path_separator.in; test for path separator
root=true
[path/separator]
key1=value1
[/top/of/path]
key2=value2
[windows\separator]
key3=value3
[windows\\separator2]
key4=value4
07070100000035000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000005B00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/path_with_special_[chars07070100000036000081A400000000000000000000000167E4418500000020000000000000000000000000000000000000007600000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/path_with_special_[chars/path_with_special_chars.inroot = true
[test.a]
key=value
07070100000037000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000004C00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/root_file07070100000038000081A400000000000000000000000167E4418500000032000000000000000000000000000000000000004F00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/root_file.inroot = true
[test.a]
key=value
[root]
name=root
07070100000039000081A400000000000000000000000167E441850000000C000000000000000000000000000000000000005900000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/root_file/root_file.inroot = true
0707010000003A000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000004D00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/root_mixed0707010000003B000081A400000000000000000000000167E441850000002D000000000000000000000000000000000000005A00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/root_mixed/root_file.inroot = TrUe
ignore = false
[*.a]
child=true
0707010000003C000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000004800000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/unset0707010000003D000081A400000000000000000000000167E4418500000124000000000000000000000000000000000000004B00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/unset.inroot = true
[charset.txt]
charset=utf-8
[end_of_line.txt]
end_of_line=lf
[indent_size.txt]
indent_size=2
[indent_style.txt]
indent_style=space
[insert_final_newline.txt]
insert_final_newline=true
[tab_width.txt]
tab_width=4
[trim_trailing_whitespace.txt]
trim_trailing_whitespace=true
0707010000003E000081A400000000000000000000000167E4418500000125000000000000000000000000000000000000005100000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/filetree/unset/unset.in
[charset.txt]
charset=unset
[end_of_line.txt]
end_of_line=unset
[indent_size.txt]
indent_size=unset
[indent_style.txt]
indent_style=unset
[insert_final_newline.txt]
insert_final_newline=unset
[tab_width.txt]
tab_width=unset
[trim_trailing_whitespace.txt]
trim_trailing_whitespace=unset
0707010000003F000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000003E00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/glob07070100000040000081A400000000000000000000000167E441850000329C000000000000000000000000000000000000004D00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/glob/CMakeLists.txt#
# Copyright (c) 2011-2018 EditorConfig Team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Tests for *
# matches a single characters
new_ec_test_multiline(star_single_ML star.in ace.c "key=value[ \t\n\r]+keyc=valuec[ \t\n\r]*")
# matches zero characters
new_ec_test_multiline(star_zero_ML star.in ae.c "key=value[ \t\n\r]+keyc=valuec[ \t\n\r]*")
# matches multiple characters
new_ec_test_multiline(star_multiple_ML star.in abcde.c "key=value[ \t\n\r]+keyc=valuec[ \t\n\r]*")
# does not match path separator
new_ec_test(star_over_slash star.in a/e.c "^[ \t\n\r]*keyc=valuec[ \t\n\r]*$")
# star after a slash
new_ec_test_multiline(star_after_slash_ML star.in Bar/foo.txt "keyb=valueb[ \t\n\r]+keyc=valuec[ \t\n\r]*")
# star matches a dot file after slash
new_ec_test_multiline(star_matches_dot_file_after_slash_ML star.in Bar/.editorconfig "keyb=valueb[ \t\n\r]+keyc=valuec[ \t\n\r]*")
# star matches a dot file
new_ec_test(star_matches_dot_file star.in .editorconfig "^keyc=valuec[ \t\n\r]*$")
# Slash makes the pattern not match in subdirectories
new_ec_test_multiline(star_after_slash_ML_in_subdir star.in
bat/Bar/foo.txt "^[ \t\n\r]*keyc=valuec[ \t\n\r]*$")
# Slash makes the pattern not match dotfiles in subdirectories
new_ec_test_multiline(star_matches_dot_file_after_slash_ML_in_subdir star.in
bat/Bar/.editorconfig "^[ \t\n\r]*keyc=valuec[ \t\n\r]*$")
# Tests for ?
# matches a single character
new_ec_test(question_single question.in some.c "^key=value[ \t\n\r]*$")
# does not match zero characters
new_ec_test(question_zero question.in som.c "^[ \t\n\r]*$")
# does not match multiple characters
new_ec_test(question_multiple question.in something.c "^[ \t\n\r]*$")
# does not match slash
new_ec_test(question_slash question.in som/.c "^[ \t\n\r]*$")
# Tests for [ and ]
# close bracket inside
new_ec_test(brackets_close_inside brackets.in ].g "^close_inside=true[ \t\n\r]*$")
# close bracket outside
new_ec_test(brackets_close_outside brackets.in b].g "^close_outside=true[ \t\n\r]*$")
# negative close bracket inside
new_ec_test(brackets_nclose_inside brackets.in c.g "^close_inside=false[ \t\n\r]*$")
# negative close bracket outside
new_ec_test(brackets_nclose_outside brackets.in c].g "^close_outside=false[ \t\n\r]*$")
# character choice
new_ec_test(brackets_choice brackets.in a.a "^choice=true[ \t\n\r]*$")
# character choice 2
new_ec_test(brackets_choice2 brackets.in c.a "^[ \t\n\r]*$")
# negative character choice
new_ec_test(brackets_nchoice brackets.in c.b "^choice=false[ \t\n\r]*$")
# negative character choice 2
new_ec_test(brackets_nchoice2 brackets.in a.b "^[ \t\n\r]*$")
# character range
new_ec_test(brackets_range brackets.in f.c "^range=true[ \t\n\r]*$")
# character range 2
new_ec_test(brackets_range2 brackets.in h.c "^[ \t\n\r]*$")
# negative character range
new_ec_test(brackets_nrange brackets.in h.d "^range=false[ \t\n\r]*$")
# negative character range 2
new_ec_test(brackets_nrange2 brackets.in f.d "^[ \t\n\r]*$")
# range and choice
new_ec_test(brackets_range_and_choice brackets.in e.e
"^range_and_choice=true[ \t\n\r]*$")
# character choice with a dash
new_ec_test(brackets_choice_with_dash brackets.in -.f
"^choice_with_dash=true[ \t\n\r]*$")
# slash inside brackets
new_ec_test(brackets_slash_inside1 brackets.in ab/cd.i
"^[ \t\n\r]*$")
new_ec_test(brackets_slash_inside2 brackets.in abecd.i
"^[ \t\n\r]*$")
new_ec_test(brackets_slash_inside3 brackets.in ab[e/]cd.i
"^slash_inside=true[ \t\n\r]*$")
new_ec_test(brackets_slash_inside4 brackets.in ab[/c
"^slash_half_open=true[ \t\n\r]*$")
# Tests for { and }
# word choice
new_ec_test(braces_word_choice1 braces.in test.py "^choice=true[ \t\n\r]*$")
new_ec_test(braces_word_choice2 braces.in test.js "^choice=true[ \t\n\r]*$")
new_ec_test(braces_word_choice3 braces.in test.html "^choice=true[ \t\n\r]*$")
new_ec_test(braces_word_choice4 braces.in test.pyc "^[ \t\n\r]*$")
# single choice
new_ec_test(braces_single_choice braces.in {single}.b "^choice=single[ \t\n\r]*$")
new_ec_test(braces_single_choice_negative braces.in .b "^[ \t\n\r]*$")
# empty choice
new_ec_test(braces_empty_choice braces.in {}.c "^empty=all[ \t\n\r]*$")
new_ec_test(braces_empty_choice_negative braces.in .c "^[ \t\n\r]*$")
# choice with empty word
new_ec_test(braces_empty_word1 braces.in a.d "^empty=word[ \t\n\r]*$")
new_ec_test(braces_empty_word2 braces.in ab.d "^empty=word[ \t\n\r]*$")
new_ec_test(braces_empty_word3 braces.in ac.d "^empty=word[ \t\n\r]*$")
new_ec_test(braces_empty_word4 braces.in a,.d "^[ \t\n\r]*$")
# choice with empty words
new_ec_test(braces_empty_words1 braces.in a.e "^empty=words[ \t\n\r]*$")
new_ec_test(braces_empty_words2 braces.in ab.e "^empty=words[ \t\n\r]*$")
new_ec_test(braces_empty_words3 braces.in ac.e "^empty=words[ \t\n\r]*$")
new_ec_test(braces_empty_words4 braces.in a,.e "^[ \t\n\r]*$")
# no closing brace
new_ec_test(braces_no_closing braces.in {.f "^closing=false[ \t\n\r]*$")
new_ec_test(braces_no_closing_negative braces.in .f "^[ \t\n\r]*$")
# nested braces
new_ec_test(braces_nested1 braces.in word,this}.g "^[ \t\n\r]*$")
new_ec_test(braces_nested2 braces.in {also,this}.g "^[ \t\n\r]*$")
new_ec_test(braces_nested3 braces.in word.g "^nested=true[ \t\n\r]*$")
new_ec_test(braces_nested4 braces.in {also}.g "^nested=true[ \t\n\r]*$")
new_ec_test(braces_nested5 braces.in this.g "^nested=true[ \t\n\r]*$")
# nested braces, adjacent at start
new_ec_test(braces_nested_start1 braces.in {{a,b},c}.k "^[ \t\n\r]*$")
new_ec_test(braces_nested_start2 braces.in {a,b}.k "^[ \t\n\r]*$")
new_ec_test(braces_nested_start3 braces.in a.k "^nested_start=true[ \t\n\r]*$")
new_ec_test(braces_nested_start4 braces.in b.k "^nested_start=true[ \t\n\r]*$")
new_ec_test(braces_nested_start5 braces.in c.k "^nested_start=true[ \t\n\r]*$")
# nested braces, adjacent at end
new_ec_test(braces_nested_end1 braces.in {a,{b,c}}.l "^[ \t\n\r]*$")
new_ec_test(braces_nested_end2 braces.in {b,c}.l "^[ \t\n\r]*$")
new_ec_test(braces_nested_end3 braces.in a.l "^nested_end=true[ \t\n\r]*$")
new_ec_test(braces_nested_end4 braces.in b.l "^nested_end=true[ \t\n\r]*$")
new_ec_test(braces_nested_end5 braces.in c.l "^nested_end=true[ \t\n\r]*$")
# closing inside beginning
new_ec_test(braces_closing_in_beginning braces.in {},b}.h "^closing=inside[ \t\n\r]*$")
# missing closing braces
new_ec_test(braces_unmatched1 braces.in {{,b,c{d}.i "^unmatched=true[ \t\n\r]*$")
new_ec_test(braces_unmatched2 braces.in {.i "^[ \t\n\r]*$")
new_ec_test(braces_unmatched3 braces.in b.i "^[ \t\n\r]*$")
new_ec_test(braces_unmatched4 braces.in c{d.i "^[ \t\n\r]*$")
new_ec_test(braces_unmatched5 braces.in .i "^[ \t\n\r]*$")
# escaped comma
new_ec_test(braces_escaped_comma1 braces.in a,b.txt "^comma=yes[ \t\n\r]*$")
new_ec_test(braces_escaped_comma2 braces.in a.txt "^[ \t\n\r]*$")
new_ec_test(braces_escaped_comma3 braces.in cd.txt "^comma=yes[ \t\n\r]*$")
# escaped closing brace
new_ec_test(braces_escaped_brace1 braces.in e.txt "^closing=yes[ \t\n\r]*$")
new_ec_test(braces_escaped_brace2 braces.in }.txt "^closing=yes[ \t\n\r]*$")
new_ec_test(braces_escaped_brace3 braces.in f.txt "^closing=yes[ \t\n\r]*$")
# escaped backslash
new_ec_test(braces_escaped_backslash1 braces.in g.txt "^backslash=yes[ \t\n\r]*$")
if((NOT WIN32) AND (NOT CYGWIN)) # this case is impossible on Windows.
new_ec_test(braces_escaped_backslash2 braces.in "\\.txt" "^backslash=yes[ \t\n\r]*$")
endif()
new_ec_test(braces_escaped_backslash3 braces.in i.txt "^backslash=yes[ \t\n\r]*$")
# patterns nested in braces
new_ec_test(braces_patterns_nested1 braces.in some.j "^patterns=nested[ \t\n\r]*$")
new_ec_test(braces_patterns_nested2 braces.in abe.j "^patterns=nested[ \t\n\r]*$")
new_ec_test(braces_patterns_nested3 braces.in abf.j "^patterns=nested[ \t\n\r]*$")
new_ec_test(braces_patterns_nested4 braces.in abg.j "^[ \t\n\r]*$")
new_ec_test(braces_patterns_nested5 braces.in ace.j "^patterns=nested[ \t\n\r]*$")
new_ec_test(braces_patterns_nested6 braces.in acf.j "^patterns=nested[ \t\n\r]*$")
new_ec_test(braces_patterns_nested7 braces.in acg.j "^[ \t\n\r]*$")
new_ec_test(braces_patterns_nested8 braces.in abce.j "^patterns=nested[ \t\n\r]*$")
new_ec_test(braces_patterns_nested9 braces.in abcf.j "^patterns=nested[ \t\n\r]*$")
new_ec_test(braces_patterns_nested10 braces.in abcg.j "^[ \t\n\r]*$")
new_ec_test(braces_patterns_nested11 braces.in ae.j "^[ \t\n\r]*$")
new_ec_test(braces_patterns_nested12 braces.in .j "^[ \t\n\r]*$")
# numeric brace range
new_ec_test(braces_numeric_range1 braces.in 1 "^[ \t\n\r]*$")
new_ec_test(braces_numeric_range2 braces.in 3 "^number=true[ \t\n\r]*$")
new_ec_test(braces_numeric_range3 braces.in 15 "^number=true[ \t\n\r]*$")
new_ec_test(braces_numeric_range4 braces.in 60 "^number=true[ \t\n\r]*$")
new_ec_test(braces_numeric_range5 braces.in 5a "^[ \t\n\r]*$")
new_ec_test(braces_numeric_range6 braces.in 120 "^number=true[ \t\n\r]*$")
new_ec_test(braces_numeric_range7 braces.in 121 "^[ \t\n\r]*$")
new_ec_test(braces_numeric_range8 braces.in 060 "^[ \t\n\r]*$")
# alphabetical brace range: letters should not be considered for ranges
new_ec_test(braces_alpha_range1 braces.in {aardvark..antelope} "^words=a[ \t\n\r]*$")
new_ec_test(braces_alpha_range2 braces.in a "^[ \t\n\r]*$")
new_ec_test(braces_alpha_range3 braces.in aardvark "^[ \t\n\r]*$")
new_ec_test(braces_alpha_range4 braces.in agreement "^[ \t\n\r]*$")
new_ec_test(braces_alpha_range5 braces.in antelope "^[ \t\n\r]*$")
new_ec_test(braces_alpha_range6 braces.in antimatter "^[ \t\n\r]*$")
# Tests for **
# test EditorConfig files with UTF-8 characters larger than 127
new_ec_test(utf_8_char utf8char.in "中文.txt" "^key=value[ \t\n\r]*$")
# matches over path separator
new_ec_test(star_star_over_separator1 star_star.in a/z.c "^key1=value1[ \t\n\r]*$")
new_ec_test(star_star_over_separator2 star_star.in amnz.c "^key1=value1[ \t\n\r]*$")
new_ec_test(star_star_over_separator3 star_star.in am/nz.c "^key1=value1[ \t\n\r]*$")
new_ec_test(star_star_over_separator4 star_star.in a/mnz.c "^key1=value1[ \t\n\r]*$")
new_ec_test(star_star_over_separator5 star_star.in amn/z.c "^key1=value1[ \t\n\r]*$")
new_ec_test(star_star_over_separator6 star_star.in a/mn/z.c "^key1=value1[ \t\n\r]*$")
new_ec_test(star_star_over_separator7 star_star.in b/z.c "^key2=value2[ \t\n\r]*$")
new_ec_test(star_star_over_separator8 star_star.in b/mnz.c "^key2=value2[ \t\n\r]*$")
new_ec_test(star_star_over_separator9 star_star.in b/mn/z.c "^key2=value2[ \t\n\r]*$")
new_ec_test(star_star_over_separator10 star_star.in bmnz.c "^[ \t\n\r]*$")
new_ec_test(star_star_over_separator11 star_star.in bm/nz.c "^[ \t\n\r]*$")
new_ec_test(star_star_over_separator12 star_star.in bmn/z.c "^[ \t\n\r]*$")
new_ec_test(star_star_over_separator13 star_star.in c/z.c "^key3=value3[ \t\n\r]*$")
new_ec_test(star_star_over_separator14 star_star.in cmn/z.c "^key3=value3[ \t\n\r]*$")
new_ec_test(star_star_over_separator15 star_star.in c/mn/z.c "^key3=value3[ \t\n\r]*$")
new_ec_test(star_star_over_separator16 star_star.in cmnz.c "^[ \t\n\r]*$")
new_ec_test(star_star_over_separator17 star_star.in cm/nz.c "^[ \t\n\r]*$")
new_ec_test(star_star_over_separator18 star_star.in c/mnz.c "^[ \t\n\r]*$")
new_ec_test(star_star_over_separator19 star_star.in d/z.c "^key4=value4[ \t\n\r]*$")
new_ec_test(star_star_over_separator20 star_star.in d/mn/z.c "^key4=value4[ \t\n\r]*$")
new_ec_test(star_star_over_separator21 star_star.in dmnz.c "^[ \t\n\r]*$")
new_ec_test(star_star_over_separator22 star_star.in dm/nz.c "^[ \t\n\r]*$")
new_ec_test(star_star_over_separator23 star_star.in d/mnz.c "^[ \t\n\r]*$")
new_ec_test(star_star_over_separator24 star_star.in dmn/z.c "^[ \t\n\r]*$")
07070100000041000081A400000000000000000000000167E4418500000374000000000000000000000000000000000000004800000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/glob/braces.in; test { and }
root=true
; word choice
[*.{py,js,html}]
choice=true
; single choice
[{single}.b]
choice=single
; empty choice
[{}.c]
empty=all
; choice with empty word
[a{b,c,}.d]
empty=word
; choice with empty words
[a{,b,,c,}.e]
empty=words
; no closing brace
[{.f]
closing=false
; nested braces
[{word,{also},this}.g]
nested=true
; nested braces, adjacent at start
[{{a,b},c}.k]
nested_start=true
; nested braces, adjacent at end
[{a,{b,c}}.l]
nested_end=true
; closing inside beginning
[{},b}.h]
closing=inside
; opening inside beginning
[{{,b,c{d}.i]
unmatched=true
; escaped comma
[{a\,b,cd}.txt]
comma=yes
; escaped closing brace
[{e,\},f}.txt]
closing=yes
; escaped backslash
[{g,\\,i}.txt]
backslash=yes
; patterns nested in braces
[{some,a{*c,b}[ef]}.j]
patterns=nested
; numeric braces
[{3..120}]
number=true
; alphabetical
[{aardvark..antelope}]
words=a
07070100000042000081A400000000000000000000000167E44185000002A2000000000000000000000000000000000000004A00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/glob/brackets.in; test [ and ]
root=true
; Character choice
[[ab].a]
choice=true
; Negative character choice
[[!ab].b]
choice=false
; Character range
[[d-g].c]
range=true
; Negative character range
[[!d-g].d]
range=false
; Range and choice
[[abd-g].e]
range_and_choice=true
; Choice with dash
[[-ab].f]
choice_with_dash=true
; Close bracket inside
[[\]ab].g]
close_inside=true
; Close bracket outside
[[ab]].g]
close_outside=true
; Negative close bracket inside
[[!\]ab].g]
close_inside=false
; Negative¬close bracket outside
[[!ab]].g]
close_outside=false
; Slash inside brackets
[ab[e/]cd.i]
slash_inside=true
; Slash after an half-open bracket
[ab[/c]
slash_half_open=true
07070100000043000081A400000000000000000000000167E4418500000029000000000000000000000000000000000000004A00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/glob/question.in; test ?
root=true
[som?.c]
key=value
07070100000044000081A400000000000000000000000167E441850000004D000000000000000000000000000000000000004600000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/glob/star.in; test *
root=true
[a*e.c]
key=value
[Bar/*]
keyb=valueb
[*]
keyc=valuec
07070100000045000081A400000000000000000000000167E4418500000071000000000000000000000000000000000000004B00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/glob/star_star.in; test **
root=true
[a**z.c]
key1=value1
[b/**z.c]
key2=value2
[c**/z.c]
key3=value3
[d/**/z.c]
key4=value4
07070100000046000081A400000000000000000000000167E4418500000067000000000000000000000000000000000000004A00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/glob/utf8char.in; test EditorConfig files with UTF-8 characters larger than 127
root = true
[中文.txt]
key = value
07070100000047000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000003E00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/meta07070100000048000081ED00000000000000000000000167E441850000089B000000000000000000000000000000000000004D00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/meta/CMakeLists.txt# tests/meta/CMakeLists.txt: Test of the test harness for editorconfig.
# BSD-2-Clause
# Copyright 2018 Christopher White (cxw42 at GitHub; http://devwrench.com)
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
set(tests_meta_cmakelists_dir "${CMAKE_CURRENT_LIST_DIR}")
# Line separator regex, for convenience
set(L "[ \t\n\r]+")
message(STATUS "meta: Using editorconfig ${EDITORCONFIG_CMD}")
# Test run_and_sort()
add_test(meta_runandsort cmake -P "${tests_meta_cmakelists_dir}/sample.cmake")
set_tests_properties(meta_runandsort PROPERTIES PASS_REGULAR_EXPRESSION
"^[\r\n]*0${L}a;b${L}b;c${L}b;e${L}b;f${L}c;b;a${L}d${L}$")
# Have to permit leading \n's - I don't know how to get rid of them
# Test the new multiline macro on a simple case. The new_ec_test_multiline
# function adds /^[\r\n]*/ to the beginning of the provided regex, and
# /$/ to the end.
new_ec_test_multiline(meta_multiline meta.in meta.c
"answer=42${L}")
07070100000049000081ED00000000000000000000000167E4418500000013000000000000000000000000000000000000004600000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/meta/meta.in[meta.c]
answer=42
0707010000004A000081A400000000000000000000000167E44185000004D2000000000000000000000000000000000000004B00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/meta/sample.cmake# sample.cmake: Tests run_and_sort to make sure it's working.
cmake_minimum_required(VERSION 3.16.3)
# See documentation links at https://stackoverflow.com/q/12802377/2877364
set( tests_meta_sample_dir "${CMAKE_CURRENT_LIST_DIR}" )
list( APPEND CMAKE_MODULE_PATH "${tests_meta_sample_dir}/../cmake" )
include( runandsort )
run_and_sort( RETVAL lines RETVAL_FAILURE did_fail
CAPTURE_STDERR TRIM_INITIAL_LEADING_SPACE # since we're using almostcat
CMDLINE "cmake" "-DWHICH:STRING=${tests_meta_sample_dir}/sample.txt"
"-P" "${tests_meta_sample_dir}/../cmake/almostcat.cmake"
) # Don't use cat(1) since we might be running on Windows
if( ${did_fail} )
message( FATAL_ERROR "Program returned a nonzero exit code" )
return()
endif()
# message() will give us an extra \n, so trim one if we can.
string( REGEX REPLACE "(\r\n|\r|\n)$" "" lines "${lines}" )
message( "${lines}" )
# This outputs to stderr, and prints nothing extra except for a \n at the end
# Note that message( STATUS "${lines}" ) doesn't work because it outputs a "--"
# before the actual content.
# You could also use execute_process( COMMAND "echo" "${lines}" )
# or cmake -E echo, but I think the message() call is good enough.
0707010000004B000081ED00000000000000000000000167E441850000001A000000000000000000000000000000000000004900000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/meta/sample.txtb;f
b;c
b;e
a;b
c;b;a
d
0
0707010000004C000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000004000000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser0707010000004D000081A400000000000000000000000167E4418500002C0E000000000000000000000000000000000000004F00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/CMakeLists.txt#
# Copyright (c) 2011-2024 EditorConfig Team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Basic parser tests
# test repeat sections
new_ec_test_multiline(repeat_sections_ML basic.in a.a "option1=value1[ \t]*[\n\r]+option2=value2[ \t\n\r]*")
new_ec_test_multiline(basic_cascade_ML basic.in b.b "option1=c[ \t]*[\n\r]+option2=b[ \t\n\r]*")
# Tests for whitespace parsing
# test no whitespaces in property assignment
new_ec_test(no_whitespace whitespace.in test1.c "^key=value[ \t\n\r]*$")
# test single spaces around equals sign
new_ec_test(single_spaces_around_equals whitespace.in test2.c
"^key=value[ \t\n\r]*$")
# test multiple spaces around equals sign
new_ec_test(multiple_spaces_around_equals whitespace.in test3.c
"^key=value[ \t\n\r]*$")
# test spaces before property name
new_ec_test(spaces_before_property_name whitespace.in test4.c
"^key=value[ \t\n\r]*$")
# test spaces before after property value
new_ec_test(spaces_after_property_value whitespace.in test5.c
"^key=value[ \t\n\r]*$")
# test blank lines between properties
new_ec_test_multiline(blank_lines_between_properties_ML whitespace.in test6.c
"key1=value1[ \t]*[\n\r]+key2=value2[ \t\n\r]*")
# test spaces in section name
new_ec_test(spaces_in_section_name whitespace.in " test 7 "
"^key=value[ \t\n\r]*$")
# test spaces before section name are ignored
new_ec_test(spaces_before_section_name whitespace.in test8.c
"^key=value[ \t\n\r]*$")
# test spaces after section name
new_ec_test(spaces_after_section_name whitespace.in test9.c "^key=value[ \t\n\r]*$")
# test spaces at beginning of line between properties
new_ec_test_multiline(spaces_before_middle_property_ML whitespace.in test10.c
"key1=value1[ \t]*[\n\r]+key2=value2[ \t]*[\n\r]+key3=value3[ \t\n\r]*")
# value with whitespace inside and the leading and trailing ws ignored
new_ec_test(value_with_whitespace_inside whitespace.in test11.c
"^key=value with whitespace inside[\n\r]+$")
# test spaces in the middle of a key
new_ec_test(spaces_in_middle_key whitespace.in test12.c "ke y=value[ \t\n\r]*")
# Tests for comment parsing
# test comments ignored before properties
new_ec_test(comment_before_props comments.in test3.c
"^key=value[ \t\n\r]*$")
# test comments ignored between properties
new_ec_test_multiline(comment_between_props_ML comments.in test4.c
"key1=value1[ \t]*[\n\r]+key2=value2[ \t\n\r]*")
# test semicolons and hashes at end of property value are included in value
new_ec_test(semicolon_or_hash_in_property comments.in test5.c
"^key1=value; not comment[\n\r]+key2=value # not comment[ \t\n\r]*$")
# test that backslashes before semicolons and hashes in property values
# are included in value.
# NOTE: [\\] matches a single literal backslash.
new_ec_test(backslashed_semicolon_or_hash_in_property comments.in test6.c
"^key1=value [\\]; not comment[\n\r]+key2=value [\\]# not comment[ \t\n\r]*$")
# test escaped semicolons are included in section names
new_ec_test(escaped_semicolon_in_section comments.in "test;.c"
"^key=value[ \t\n\r]*$")
# test octothorpe comments ignored before properties
new_ec_test(octothorpe_comment_before_props comments.in test9.c
"^key=value[ \t\n\r]*$")
# test octothorpe comments ignored between properties
new_ec_test_multiline(octothorpe_comment_between_props_ML comments.in test10.c
"key1=value1[ \t]*[\n\r]+key2=value2[ \t\n\r]*")
# test octothorpe at end of property value are included in value
new_ec_test(octothorpe_in_value comments.in test11.c
"^key=value# not comment[ \t\n\r]*$")
# test escaped octothorpes are included in section names
new_ec_test(escaped_octothorpe_in_section comments.in "test\#.c"
"^key=value[ \t\n\r]*$")
# test EditorConfig files with BOM at the head
new_ec_test(bom_at_head bom.in "a.c" "^key=value[ \t\n\r]*$")
# test EditorConfig files with CRLF line separators
new_ec_test(crlf_linesep crlf.in "a.c" "^key=value[ \t\n\r]*$")
# Test minimum supported lengths of section name, key and value
new_ec_test(min_supported_key_length limits.in test1
"^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[ \t\n\r]*$")
new_ec_test(min_supported_section_name_length limits.in test3
"^k1024=v1024[ \t\n\r]*$")
# Empty .editorconfig files
new_ec_test(empty_editorconfig_file empty.in test4 "^[ \t\n\r]*$")
new_ec_test(newlines_only_editorconfig_file newlines_only.in test4 "^[ \t\n\r]*$")
new_ec_test(comments_only_editorconfig_file comments_only.in test4 "^[ \t\n\r]*$")
new_ec_test(comments_and_newlines_editorconfig_file comments_and_newlines.in test4 "^[ \t\n\r]*$")
# A value set to empty string
new_ec_test(key_set_to_empty_string empty_values.in test1 "^key1=[\n\r]+key2=[\n\r]+key3=[\n\r]+$")
# Leading slash test
new_ec_test(leading_slash_relevance leading_slash.in test1/file.java "^key1=val1[\n\r]+key2=val2[\n\r]+key3=val3[\n\r]+$")0707010000004E000081A400000000000000000000000167E4418500000081000000000000000000000000000000000000004900000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/basic.in[*.a]
option1=value1
; repeat section
[*.a]
option2=value2
[*.b]
option1 = a
option2 = a
[b.b]
option2 = b
[*.b]
option1 = c
0707010000004F000081A400000000000000000000000167E4418500000044000000000000000000000000000000000000004700000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/bom.in; test EditorConfig files with BOM
root = true
[*]
key = value
07070100000050000081A400000000000000000000000167E441850000031F000000000000000000000000000000000000004C00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/comments.in; test comments
root = true
[test3.c]
; Comment before properties ignored
key=value
[test4.c]
key1=value1
; Comment between properties ignored
key2=value2
; Semicolon or hash at end of value read as part of value
[test5.c]
key1=value; not comment
key2=value # not comment
; Backslash before a semicolon or hash is part of the value
[test6.c]
key1=value \; not comment
key2=value \# not comment
; Escaped semicolon in section name
[test\;.c]
key=value
[test9.c]
# Comment before properties ignored
key=value
[test10.c]
key1=value1
# Comment between properties ignored
key2=value2
# Octothorpe at end of value read as part of value
[test11.c]
key=value# not comment
# Escaped octothorpe in value
[test12.c]
key=value \# not comment
# Escaped octothorpe in section name
[test\#.c]
key=value
07070100000051000081A400000000000000000000000167E4418500000025000000000000000000000000000000000000005900000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/comments_and_newlines.in
# Just comments
# ... and newlines
07070100000052000081A400000000000000000000000167E441850000001E000000000000000000000000000000000000005100000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/comments_only.in# Just a comment, nothing else07070100000053000081A400000000000000000000000167E4418500000058000000000000000000000000000000000000004800000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/crlf.in; test EditorConfig files with CRLF line separators
root = true
[*]
key = value
07070100000054000081A400000000000000000000000167E4418500000000000000000000000000000000000000000000004900000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/empty.in07070100000055000081A400000000000000000000000167E4418500000098000000000000000000000000000000000000005000000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/empty_values.inroot = true
[test1]
; A value set to empty string
key1=
; Whitespace after equals sign is ignored
key2=
; A file final key set to empty string
key3=
07070100000056000081A400000000000000000000000167E4418500000104000000000000000000000000000000000000005100000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/leading_slash.inroot = true
[/test1/file.{java,js,rb}]
; Has a leading slash along with a slash in between
key1=val1
[test1/file.{java,js,rb}]
; Has no leading slash but has a slash in between
key2=val2
[*.{java,js,rb}]
; Has no slash at all but still should match
key3=val3
07070100000057000081A400000000000000000000000167E44185000018F5000000000000000000000000000000000000004A00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/limits.inroot = true
; minimum supported key length of 1024 characters
[test1]
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}]
k1024=v1024
07070100000058000081A400000000000000000000000167E4418500000002000000000000000000000000000000000000005100000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/newlines_only.in
07070100000059000081A400000000000000000000000167E44185000002F4000000000000000000000000000000000000004E00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/parser/whitespace.in; test whitespace usage
root = true
; no whitespace
[test1.c]
key=value
; spaces around equals
[test2.c]
key = value
; lots of space after equals
[test3.c]
key = value
; spaces before property name
[test4.c]
key=value
; spaces after property value
[test5.c]
key=value
; blank lines between properties
[test6.c]
key1=value1
key2=value2
; spaces in section name
[ test 7 ]
key=value
; spaces before section name
[test8.c]
key=value
; spaces after section name
[test9.c]
key=value
; spacing before middle property
[test10.c]
key1=value1
key2=value2
key3=value3
; value with whitespace inside and the leading and trailing ws ignored
[test11.c]
key= value with whitespace inside
; space in the middle of a key
[test12.c]
ke y=value0707010000005A000041ED00000000000000000000000267E4418500000000000000000000000000000000000000000000004400000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/properties0707010000005B000081A400000000000000000000000167E4418500000DBD000000000000000000000000000000000000005300000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/properties/CMakeLists.txt#
# Copyright (c) 2011-2018 EditorConfig Team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# test tab_width default
new_ec_test_multiline(tab_width_default_ML tab_width_default.in test.c
"indent_size=4[ \t]*[\n\r]+indent_style=space[ \t]*[\n\r]+tab_width=4[\t\n\r]*")
# Tab_width should not be set to any value if indent_size is "tab" and
# tab_width is not set
new_ec_test_multiline(tab_width_default_indent_size_tab_ML tab_width_default.in test2.c
"indent_size=tab[ \t]*[\n\r]+indent_style=tab[ \t\n\r]*")
# Test indent_size default. When indent_style is "tab", indent_size defaults to
# "tab".
new_ec_test_multiline(indent_size_default_ML indent_size_default.in test.c
"indent_size=tab[ \t]*[\n\r]+indent_style=tab[ \t\n\r]*")
# Test indent_size default. When indent_style is "tab", indent_size should have
# no default value for version prior than 0.9.0.
new_ec_test_version(indent_size_default_pre_0_9_0 indent_size_default.in test.c
"^indent_style=tab[ \t\n\r]*$" 0.8.0)
# Test indent_size default. When indent_style is "space", indent_size has no
# default value.
new_ec_test(indent_size_default_space indent_size_default.in test2.c
"^indent_style=space[ \t\n\r]*$")
# Test indent_size default. When indent_style is "tab" and tab_width is set,
# indent_size should default to tab_width
new_ec_test_multiline(indent_size_default_with_tab_width_ML
indent_size_default.in test3.c
"indent_size=2[ \t]*[\n\r]+indent_style=tab[ \t]*[\n\r]+tab_width=2[ \t\n\r]*")
# test that same property values are lowercased (v0.9.0 properties)
new_ec_test_multiline(lowercase_values1_ML lowercase_values.in test1.c
"end_of_line=crlf[ \t]*[\n\r]+indent_style=space[ \t\n\r]*")
# test that same property values are lowercased (v0.9.0 properties)
new_ec_test_multiline(lowercase_values2_ML lowercase_values.in test2.c
"charset=utf-8[ \t]*[\n\r]+insert_final_newline=true[ \t]*[\n\r]+trim_trailing_whitespace=false[ \t\n\r]*$")
# test that same property values are not lowercased
new_ec_test(lowercase_values3 lowercase_values.in test3.c
"^test_property=TestValue[ \t\n\r]*$")
# test that all property names are lowercased
new_ec_test(lowercase_names lowercase_names.in test.c
"^testproperty=testvalue[ \t\n\r]*$")
0707010000005C000081A400000000000000000000000167E4418500000075000000000000000000000000000000000000005B00000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/properties/indent_size_default.inroot = true
[test.c]
indent_style = tab
[test2.c]
indent_style = space
[test3.c]
indent_style = tab
tab_width = 2
0707010000005D000081A400000000000000000000000167E441850000005A000000000000000000000000000000000000005700000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/properties/lowercase_names.in; test that property names are lowercased
root = true
[test.c]
TestProperty = testvalue
0707010000005E000081A400000000000000000000000167E44185000000DE000000000000000000000000000000000000005800000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/properties/lowercase_values.in; test property name lowercasing
root = true
[test1.c]
indent_style = Space
end_of_line = CRLF
[test2.c]
insert_final_newline = TRUE
trim_trailing_whitespace = False
charset = UTF-8
[test3.c]
test_property = TestValue
0707010000005F000081A400000000000000000000000167E441850000006B000000000000000000000000000000000000005900000000editorconfig-core-py-0.17.0+git.1743012229.8dca1b6/tests/properties/tab_width_default.inroot = true
[test.c]
indent_style = space
indent_size = 4
[test2.c]
indent_style = tab
indent_size = tab
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!299 blocks