<!--
SPDX-FileCopyrightText: Peter Pentchev <roam@ringlet.net>
SPDX-License-Identifier: BSD-2-Clause
-->

# Change log for confget, the configuration file variable extractor

## [Unreleased]

## [5.1.2] - 2023-08-26

### Fixes

- Python implementation:
    - various minor fixes suggested by Ruff
    - minor fixes related to the wider use of `pathlib.Path` now
- Test suite:
    - do not even try to run the character-encoding-related tests in
      15-bespoke-encoding with no locale specified in the `LC_ALL`
      environmentt variable; it is possible that the default locale
      (e.g. the "POSIX"/"C" one) does not contain any mapping for
      the byte codes used to represent the "enye" UTF-8 character

### Additions

- Python implementation:
    - test-docker: add a framework for running the Python test suite
      within a Docker container so that it can be tested with
      old Python versions, e.g. Python 3.6 on CentOS 7

### Other changes

- Reformat the copyright notices and license grants:
    - replace the copyright notices and license grants with SPDX tags
    - drop the copyright years in the copyright tags
    - add my e-mail address to the copyright tags
    - relicense the public-domain files under the CC0 license
- Python implementation:
    - switch from `setuptools` to `hatchling` for the PEP 517 build
    - let the Black formatter know which versions of Python we target
    - add a `reuse` test environment to validate the SPDX tags and
      list some build and test artifacts in the `.gitignore` file
    - switch from `ddt` to `pytest.mark.parametrize` for the unit tests
    - use the `tox-stages` tool in the `tox-devel.sh` helper
    - use Ruff's `isort` implementation and rename the `black` and
      `black-reformat` test environments to `format` and `reformat`
    - use Ruff instead of Flake8 and Pylint
    - test with MyPy 1.x with no changes
    - drop an outdated piece of diagnostic code and two empty comment lines
    - convert the `tox.ini` file to the Tox 4.x format
- Rust implementation:
    - bump the versions of some crates we depend on; no functional changes
    - let clippy know that it is okay to use the `ref` keyword,
      the question mark operator, and a semicolon outside of a block
    - add a note to the `run-clippy.sh` tool that the enabled/disabled
      checks are synced with the clippy version in Rust 1.71

## [5.1.1] - 2023-04-18

### Fixes

- Changelog:
    - fix the indentation
- Python implementation:
    - add a dependency on the `dataclasses` library for Python 3.6
- Nix tests:
    - add a dependency on the Python `pyparsing` library

### Other changes

- Changelog:
    - add repository links to the version entry headings
    - change the date format in the entry headings from YYYY/MM/DD to
      YYYY-MM-DD
- Rust implementation:
    - update the versions of some dependencies with no changes

## [5.1.0] - 2023-02-14

- add some tests with mostly empty INI-style files
- Python implementation:
    - fix parsing an INI-style file containing variables but no section
      headers using the default pyparsing-based implemenation
    - add the `confget.defs.BackendType` enum listing the supported backends
      (including the `INI` one that is internally handled as the default
       INI-style backend, currently the pyparsing-based one)
    - use black 23.x, flake8 6.x, pylint 2.16.x
    - drop the mention of the long-gone pylintrc file from the manifest
    - add Tox environment tags for use by the `tox-stages` tool
    - activate most of the plugins that come with pylint 2.16.x, fix some
      minor issues reported by them
- Rust implementation:
    - use named arguments to `format!(..)`, `println!(...)`, etc.
    - bump the required versions of `regex` and `tempfile` for some bugfixes
    - minor clean-up changes, mostly following clippy's suggestions
    - catch up with the clap crate's error message for options used more than
      once that changed yet again

## [5.0.1] - 2022-11-28

- Python implementation:
    - do not build a universal wheel, we do not support Python 2.x any more

## [5.0.0] - 2022-11-28

- INCOMPATIBLE CHANGES:
    - C implementation
        - fix variable name and value matching in UTF-8 locales
    - Python implementation:
        - drop Python 2.x support
        - change the way line continuations are handled in INI files:
          preserve trailing whitespace on all but the last line,
          preserve leading whitespace on all lines
        - do not assume INI-style input files are always encoded in UTF-8;
          use the character encoding of the current locale's
          `LC_CTYPE` setting
    - Rust implementation:
        - all the functions now return a `ConfgetError` enum instead of
          `Box<dyn Error>`; that enum is implemented using the thiserror
          and anyhow libraries
        - make sure that a filename to read from is specified in
          the configuration at backend construction time, not when
          the file is read
        - change the way line continuations are handled in INI files:
          preserve trailing whitespace on all but the last line,
          preserve leading whitespace on all lines
        - make the list of features (in the feature-check sense, not in
          the crate features sense) available using a new `features()`
          function instead of jumping through hoops to dynamically build
          a static array
        - drop the deprecated `Config::get_default()` function
        - do not assume INI-style input files are always encoded in UTF-8;
          use the character encoding of the current locale's
          `LC_CTYPE` setting
- Python implementation:
    - add the ini-pyp backend that uses the pyparsing library and
      use it by default; rename the one used until now to ini-regex
    - drop the six dependency now that we no longer support Python 2.x
    - make use of Python 3.x features:
        - no need to inherit from the object class
        - use `super()` without arguments
        - use f-strings and type annotations
        - use dataclasses instead of reimplementing them
        - use `shlex.quote()` instead of reimplementing it
        - use dict comprehensions
        - use `@property @abstractmethod` instead of `@abstractproperty`
        - drop the `print_function` future import
        - use the class syntax for typed named tuples
        - use `open()` instead of `io.open()`
        - switch to a declarative setuptools config and a PEP517 build
    - test suite: bump the minimal mypy version to 0.981 for the abstract
      dataclasses bugfix
- Rust implementation:
    - add the ini-nom backend and use it by default; rename the one used
      until now to ini-regex and add crate features for both
    - use anyhow instead of expect-exit in the command-line tool, too
    - define the SectionData and FileData types for more readable
      function signatures
    - validate the command-line argument combinations in
      an easier-to-read manner
    - explicitly override clippy's std-instead-of-alloc and
      std-instead-of-core lints, there is very little chance that
      confget will ever be built in a no-std configuration
    - minor changes suggested by clippy
    - drop the unused percent-encoding dependency, it has not been
      necessary since the `http_get` backend was dropped in version 3.0.0
    - use the shell-words library instead of reimplementing it
    - add a trivial test suite using copies of the `t*.ini` files
    - use clap 4.x instead of 3.x
- Test suite:
    - be more permissive in the shell quoting tests, since the Python and
      Rust implementations now use different libraries that produce
      different strings, but still as safe as before
    - fix the TAP output for failing tests in the 10-bespoke-qsections set
    - refactor the 10-bespoke-qsections set for better maintainability
    - add the 15-bespoke-encoding test to make sure that the command-line
      `confget` tool parses INI-style files using the character encoding
      specified by the current locale's `LC_CTYPE` setting
- add Nix expressions for testing the Python and C implementations

## [4.1.1] - 2022-09-11

- add an EditorConfig definitions file
- Python implementation:
    - add lower and upper version constraints to the dependencies
      specified in the tox.ini test environment definitions
    - use black 22 for source code formatting
    - reformat the source code with 100 characters per line
    - specify a pylint minimum version 2.14 and stop overriding
      two diagnostic messages that were declared obsolete or
      made optional
    - drop the flake8 + hacking test environment altogether
    - move the pylint configuration to the pyproject.toml file
    - include the `tox-devel.sh` file in the sdist tarball
    - declare Python 3.8 through 3.11 as supported
- Rust implementation:
    - heavily refactor following Rust idiomatic style and
      the clippy tool's suggestions
    - use the `Termination` trait that requires Rust 1.61
    - fix the formatting of the copyright/license notice
    - add the `run-clippy.sh` tool for elaborate diagnostics
    - obtain the crate's version from the Cargo environment
    - use expect-exit 0.5.x and its `bool.or_exit()` functions
    - use expect-exit instead of `ConfgetError` in most places
    - keep the `Cargo.lock` file under version control

## [4.1.0] - 2021-11-28

- declare the `REGEX` and the `REGEX_IMPL_<language>_<library>`
  features and check for `REGEX` in the TAP test
- C implementation:
    - add support for the pcre2 library and make it the default
- Python implementation:
    - tests: add a version to the dependency on the "hacking" library
      to help out recent versions of pip with the combinatorial
      explosion
- Rust implementation:
    - declare compatibility with the 2021 edition with no changes

## [4.0.1] - 2021-10-01

- Python implementation:
    - fix the unit tests on Python 3.5: open the test files in
      text mode, not in binary mode
    - add `MANIFEST.in` to include more files in the sdist archive

## [4.0.0] - 2021-09-29

- INCOMPATIBLE CHANGE:
- C implementation: when showing more than one variable, order them
  by variable name instead of whatever order they appeared in
  the input file. This brings the C implementation in line with
  the Python and Rust ones.
- Python implementation:
    - do not use `open()` without an encoding specified: either open
      the files in binary mode or use `io.open()` and specify it
    - cap the version of the Python 2.x configparser dependency
    - fix a test class constructor name
    - silence a pylint diagnostic message about f-strings; we still
      have to support Python 2.x for a while longer
    - silence a pylint diagnostic message about `abstractproperty`
      being deprecated for the same reason
- Rust implementation:
    - turn `html_root_url` into a crate-level attribute
    - drop some unneeded borrows

## [3.0.2] - 2021-06-23

- Python implementation
    - tox tests: catch up with the mypy dependency changes
- Rust implementation:
    - implement the `Default` trait for the `Config` object;
      the `get_default()` method is now deprecated
    - use version 0.4 of the expect-exit crate
    - fix the code examples in the documentation
    - add the `html_root_url` documentation attribute
    - add a link to the change log on GitLab

## [3.0.1] - 2021-05-12

- Rust implementation:
    - implement some suggestions from the clippy tool
    - add some Cargo.toml/crates.io metadata

## [3.0.0] - 2021-05-11

- INCOMPATIBLE CHANGES:
- the `http_get` backend has been dropped, `ini` is currently
  the only confget backend
- add a test querying a single variable in list-all mode
- Python implementation: 
    - the INI file is opened when `read_file()` is invoked, not
      when the backend object is constructed
    - rename the "black\_reformat" tox environment to "black-reformat"
    - explicitly specify black version 21
    - disable some more pylint diagnostics, since we still need to
      preserve Python 2.x compatibility
    - improve the `tox-devel.sh` experience a bit
    - add "six" as a dependency to the "pylint" tox environment,
      since pylint itself no longer depends on it
    - add the `read_ini_file()` convenience function
    - use the `read_ini_file()` function in the command-line tool,
      since right now there are no other backends
- add a Rust implementation


## [2.3.4] - 2020-05-02

- add a test for values containing a "=" character
- add a test for the "-P suffix" command-line option
- Python implementation:
    - fix a bug parsing values containing a "=" character
    - implement the "-P suffix" command-line option
    - setup.py: use `tests_require` instead of `test_requires`
    - push the source down into a `src/` subdirectory

## [2.3.3] - 2020-04-07

- Python implementation: allow the tests to be run from
  another directory, e.g. the confget top-level source one
- Makefile: if `NO_DOC_BUILD` is set, do not build the manual
  page and do not install it and the examples

## [2.3.2] - 2020-04-06

- Python implementation improvements and bugfixes:
    - reformat the function and module docstrings
    - make some imports conditional on the Python version
    - separate the tests into developer-only (to be run within
      the full confget source tree) and sdist-ready
    - make it possible to run some tests from the sdist
    - fix some test infrastructure nits

## [2.3.1] - 2020-04-01

- fix the Python's top-level module typed exports
- fix two pylint false positives in the Python module

## [2.3.0] - 2019-09-09

- fix a typographical error in the previous changelog entry
- also exclude the PyPy implementation from the check for
  too many long options in the `14-bespoke-too-many` test
- Python implementation:
    - reformat the source code using the black tool
    - handle input encodings correctly for the standard input
    - add the `get_parser()` method to return a `ConfigParser` object
    - make the unit tests less verbose
    - move the configuration for the black, flake8, and pylint
      tools out of tox.ini into other configuration files
- C implementation:
    - show the correct version number in the "-q features" output

## [2.2.0] - 2019-01-13

- add a Python implementation: a confget library that may
  also be invoked from the command line with the same
  interface as the C confget tool
- generate the TAP tests automatically from JSON definitions

## [2.1.1] - 2018-11-27

- fix the check for more than one requested query type

## [2.1.0] - 2017-11-11

- allow the installation commands to be overridden, e.g. for
  package builds which do not require root privileges
- add "-q features" and "-q feature NAME" with only the "BASE"
  feature defined so far
- support "--help" and "--version"

## [2.0.0] - 2016-04-03

- INCOMPATIBLE CHANGES:
    - if a variable is specified more than once in the config file,
      only the *last* value will be displayed regardless of the presence or
      the order of the confget command-line options; previously,
      confget without "-l" would only display the first value
    - the configuration file is always parsed completely and any syntax
      errors will cause confget to fail even if they occur after
      the specification of the requested variables
    - confget now requires a C99 compiler to build.  This is activated
      by the "-std=c99" option passed to the compiler; to override this,
      Set the `STD_CFLAGS` environment variable
- Other changes:
    - replace `_BSD_SOURCE` and `_GNU_SOURCE` with `_POSIX_C_SOURCE` and
      `_XOPEN_SOURCE`
    - install the test scripts themselves in addition to the test
      config files as examples
    - teach the manual page test about compressed manpage files
    - use linker flags for Large File Support, too, if provided
    - treat an empty section name (`-s ''`) as requesting only variables
      declared before any section has been defined
    - remove an outdated -f option specification in the HTTP GET
      example in the manual page
    - clean up some of the use of the `strcmp(3)` function
    - clean up some internal error handling
    - remove the obsolete `$Ringlet` VCS tags from the source files
    - minimize the scope of some variables by using C99 declarations
    - add the -O (override) command-line option allowing variables in
      a certain section to override those in the unnamed section at
      the start of the config file

## [1.05] - 2013-11-03

- display the version string before the help if both requested
- support building without a `.depend` file
- use the C99 `%z` `printf(3)` format specifier and remove
  the less portable `long long` casts
- add `const` qualifiers to lots of pointers
- make `makedep.sh` honor `CC` and quote some expansions there
- build with large file support under Linux by defining
  `_FILE_OFFSET_BITS` to be 64

## [1.04] - 2012-10-11

- detect automatically the "read-a-line" C library function
  (`getline(3)` or `fgetln(3)`) by trying to compile and link simple
  programs using either one
- separate the C preprocessor flags from the C compiler flags:
  - honor `CPPFLAGS` if passed by a build system
  - rename the `PCRE_CFLAGS` variable to `PCRE_CPPFLAGS`, since that
    is what it actually is
  - pass `CPPFLAGS` instead of `CFLAGS` to `makedep.sh` and use them
- stop misusing `LFLAGS`, use just `LDFLAGS` as we should
- add the "-q sections" command-line option to list the names of
  the sections in an INI file
- add the `10-qsections` test for the above

## [1.03] - 2011-07-06

- support spaces in INI file section names, as suggested by
  [green](mailto:greenfreedom10@gmail.com) in
  [Debian bug #632400](https://bugs.debian.org/632400)
- do not make the compiler warnings fatal by default

## [1.02] - 2009-03-20

- do not fail the regexp tests if confget was compiled without
  regular expression support
- explain the `Config::IniFiles` cross-reference in the manual
  page, as discussed with George Danchev on the debian-mentors
  mailing list
- split the install target into separate targets for the various
  components of the program
- add some comments to the `t/t1.ini` and `t/t2.ini` files, describing
  the structure of the INI files parsed by confget
- install the `t1.ini` and `t2.ini` files as examples, as discussed
  with George Danchev on the debian-mentors mailing list

## [1.01] - 2008-11-06

- if '-' is specified for the configuration file name, read from
  the standard input stream
- improve the general description of confget in the manual page
- add an `http_get` backend for decoding HTTP GET request variables
- make the filename argument non-mandatory, since there are
  configuration types (e.g. `http_get`) that do not read their data
  from a file
- completely drop the non-functional stub for a Java properties
  backend type

## [1.00] - 2008-10-16

- add the '-p prefix' and '-P postfix' command-line options
- add the '-S' command-line flag so shell scripts may safely
  read individual variables or slurp the contents of whole sections
- add regular expression support through the PCRE library and
  the '-x' command-line flag

## [0.03] - 2008-10-14

- avoid overlong strings in confget.c's `usage()` function
- add sample high-warning-level compiler flags to the Makefile
- protect argument names in the function declarations
- do not use a generic name such as "fp" for a global variable
- clear out the config file variable after closing the file
- pull in the correct definition for `strdup()`

## [0.02] - 2008-10-14

- by default, use the binary files' group for the manpages, too
- add support for different configuration file types
    - ini - the already-supported INI file backend
- add the '-t type' and '-T' command-line options
- add a trivial `README` file
- add a simple `TODO` list
- automatically track source dependencies
- use `fgetln(3)` or `getline(3)` to read lines from a file
- move more variable matching logic into `foundvar()`
- fix a bug when parsing key/value lines without whitespace
- add the -L command-line option to display all variables with
  names matching the specified pattern
- mark some `Makefile` targets as phony
- allow more than one variable or pattern to be specified on
  the command line
- note that either `-DHAVE_GETLINE` or `-DHAVE_FGETLN` must be defined
  in the C compiler's flags at build time
- make the section argument optional and let the first section in
  the INI file be used instead
- add the -m command-line option to match the values against a pattern

## [0.01] - 2008-09-25

- Initial public release.

Comments: Peter Pentchev <roam@ringlet.net>

[Unreleased]: https://gitlab.com/confget/confget/-/compare/release%2F5.1.2...master
[5.1.2]: https://gitlab.com/confget/confget/-/compare/release%2F5.1.1...release%2F5.1.2
[5.1.1]: https://gitlab.com/confget/confget/-/compare/release%2F5.1.0...release%2F5.1.1
[5.1.0]: https://gitlab.com/confget/confget/-/compare/release%2F5.0.1...release%2F5.1.0
[5.0.1]: https://gitlab.com/confget/confget/-/compare/release%2F5.0.0...release%2F5.0.1
[5.0.0]: https://gitlab.com/confget/confget/-/compare/release%2F4.1.1...release%2F5.0.0
[4.1.1]: https://gitlab.com/confget/confget/-/compare/release%2F4.1.0...release%2F4.1.1
[4.1.0]: https://gitlab.com/confget/confget/-/compare/release%2F4.0.1...release%2F4.1.0
[4.0.1]: https://gitlab.com/confget/confget/-/compare/release%2F4.0.0...release%2F4.0.1
[4.0.0]: https://gitlab.com/confget/confget/-/compare/release%2F3.0.2...release%2F4.0.0
[3.0.2]: https://gitlab.com/confget/confget/-/compare/release%2F3.0.1...release%2F3.0.2
[3.0.1]: https://gitlab.com/confget/confget/-/compare/release%2F3.0.0...release%2F3.0.1
[3.0.0]: https://gitlab.com/confget/confget/-/compare/release%2F2.3.4...release%2F3.0.0
[2.3.4]: https://gitlab.com/confget/confget/-/compare/release%2F2.3.3...release%2F2.3.4
[2.3.3]: https://gitlab.com/confget/confget/-/compare/release%2F2.3.2...release%2F2.3.3
[2.3.2]: https://gitlab.com/confget/confget/-/compare/release%2F2.3.1...release%2F2.3.2
[2.3.1]: https://gitlab.com/confget/confget/-/compare/release%2F2.3.0...release%2F2.3.1
[2.3.0]: https://gitlab.com/confget/confget/-/compare/release%2F2.2.0...release%2F2.3.0
[2.2.0]: https://gitlab.com/confget/confget/-/compare/release%2F2.1.1...release%2F2.2.0
[2.1.1]: https://gitlab.com/confget/confget/-/compare/release%2F2.1.0...release%2F2.1.1
[2.1.0]: https://gitlab.com/confget/confget/-/compare/release%2F2.0.0...release%2F2.1.0
[2.0.0]: https://gitlab.com/confget/confget/-/compare/release%2F1.05...release%2F2.0.0
[1.05]: https://gitlab.com/confget/confget/-/compare/release%2F1.04...release%2F1.05
[1.04]: https://gitlab.com/confget/confget/-/compare/release%2F1.03...release%2F1.04
[1.03]: https://gitlab.com/confget/confget/-/compare/release%2F1.02...release%2F1.03
[1.02]: https://gitlab.com/confget/confget/-/compare/release%2F1.01...release%2F1.02
[1.01]: https://gitlab.com/confget/confget/-/compare/release%2F1.00...release%2F1.01
[1.00]: https://gitlab.com/confget/confget/-/compare/release%2F0.03...release%2F1.00
[0.03]: https://gitlab.com/confget/confget/-/compare/release%2F0.02...release%2F0.03
[0.02]: https://gitlab.com/confget/confget/-/compare/release%2F0.01...release%2F0.02
[0.01]: https://gitlab.com/confget/confget/-/tags/release%2F0.01
