<commit_before>CHANGES
*******

0.13 (unreleased)
=================

- **Breaking change**. Morepath has a new, extensively refactored
  configuration system based on dectate_ and importscan_. Dectate is
  an extracted, and heavily refactored version of Morepath's
  configuration system that used to be in ``morepath.config``
  module. It's finally documented too!

  .. _dectate: http://dectate.readthedocs.org

  .. _importscan: http://importscan.readthedocs.org

  Dectate and thus Morepath does not use Venusian (or Venusifork)
  anymore so that dependency is gone.

  Code that uses ``morepath.autosetup`` should still work.

  Code that uses ``morepath.setup`` and scans and commits manually
  needs to change. Change this::

    from morepath import setup

    config = morepath.setup()
    config.scan(package)
    config.commit()

  into this::

    import morepath

    morepath.scan(package)
    morepath.autocommit()

  Similarly ``config.scan()`` without arguments to scan its own
  package needs to be rewritten to use ``morepath.scan()`` without
  arguments.

  Anything you import directly now does not need to be scanned
  anymore; the act of importing a module directly registers the
  directives with Morepath, though as before they won't be active
  until you commit. But scanning something you've imported before
  won't do any harm.

  The signature for ``morepath.scan`` is somewhat different than that
  of the old ``config.scan``. There is no third argument
  ``recursive=True`` anymore. The ``onerror`` argument has been
  renamed to ``handle_error`` and has different behavior; the
  importscan_ documentation describes the details.

  If you were writing tests that involve Morepath, the old structure of
  the test was::

    import morepath

    def test_foo():
        config = morepath.setup()

        class App(morepath.App):
            testing_config = config

        ... use directives on App ...

        config.commit()

        ... do asserts ...

  This now needs to change to::

    import morepath

    def test_foo():
        class App(morepath.App):
            pass

        ... use directives on App ...

        morepath.commit([App])

        ... do asserts ...

  So, you need to use the ``morepath.commit()`` function and give it a
  list of the application objects you want to commit,
  explicitly. ``morepath.autocommit()`` won't work in the context of a
  test.

  If you used a test that scanned code you need to adjust it too, from::

    import morepath
    import some_package

    def test_foo():
        config = morepath.setup()

        config.scan(some_package)

        config.commit()

        ... do asserts ...

  to this::

    import morepath
    import some_package

    def test_foo():
        morepath.scan(some_package)
        morepath.commit([some_package.App])

        ... do asserts ...

  Again you need to be explicit and use ``morepath.commit`` to commit
  those apps you want to test.

  If you had a low-level reference to ``app.registry`` in your code
  you now need to change this to ``app.config.registry``. Expect more
  changes to this in future versions -- thanks to the dectate library
  we can now start breaking up the big registry into multiple
  independent ones all stored under ``app.config``.

  If you created custom directives, the way to create directives
  is now documented as part of the dectate_ project. The main updates you
  need to do are:

  * subclass from `dectate.Action` instead of `morepath.Directive`.

  * no more ``app`` first argument.

  * no ``super`` call is needed anymore in ``__init__``.

  * add a ``config`` class variable to declare the registries
    you want to affect. Until we break up the main registry this
    is::

      from morepath.app import Registry

      ...
      config = { 'registry': Registry }


  * reverse the arguments to ``perform``, so change::

      def perform(self, registry, obj):
         ...

    into::

      def perform(self, obj, registry):
         ...
<commit_msg>Clarify.<commit_after>CHANGES
*******

0.13 (unreleased)
=================

- **Breaking change**. Morepath has a new, extensively refactored
  configuration system based on dectate_ and importscan_. Dectate is
  an extracted, and heavily refactored version of Morepath's
  configuration system that used to be in ``morepath.config``
  module. It's finally documented too!

  .. _dectate: http://dectate.readthedocs.org

  .. _importscan: http://importscan.readthedocs.org

  Dectate and thus Morepath does not use Venusian (or Venusifork)
  anymore so that dependency is gone.

  Code that uses ``morepath.autosetup`` should still work.

  Code that uses ``morepath.setup`` and scans and commits manually
  needs to change. Change this::

    from morepath import setup

    config = morepath.setup()
    config.scan(package)
    config.commit()

  into this::

    import morepath

    morepath.scan(package)
    morepath.autocommit()

  Similarly ``config.scan()`` without arguments to scan its own
  package needs to be rewritten to use ``morepath.scan()`` without
  arguments.

  Anything you import directly now does not need to be scanned
  anymore; the act of importing a module directly registers the
  directives with Morepath, though as before they won't be active
  until you commit. But scanning something you've imported before
  won't do any harm.

  The signature for ``morepath.scan`` is somewhat different than that
  of the old ``config.scan``. There is no third argument
  ``recursive=True`` anymore. The ``onerror`` argument has been
  renamed to ``handle_error`` and has different behavior; the
  importscan_ documentation describes the details.

  If you were writing tests that involve Morepath, the old structure of
  the test was::

    import morepath

    def test_foo():
        config = morepath.setup()

        class App(morepath.App):
            testing_config = config

        ... use directives on App ...

        config.commit()

        ... do asserts ...

  This now needs to change to::

    import morepath

    def test_foo():
        class App(morepath.App):
            pass

        ... use directives on App ...

        morepath.commit([App])

        ... do asserts ...

  So, you need to use the ``morepath.commit()`` function and give it a
  list of the application objects you want to commit,
  explicitly. ``morepath.autocommit()`` won't work in the context of a
  test.

  If you used a test that scanned code you need to adjust it too, from::

    import morepath
    import some_package

    def test_foo():
        config = morepath.setup()

        config.scan(some_package)

        config.commit()

        ... do asserts ...

  to this::

    import morepath
    import some_package

    def test_foo():
        morepath.scan(some_package)
        morepath.commit([some_package.App])

        ... do asserts ...

  Again you need to be explicit and use ``morepath.commit`` to commit
  those apps you want to test.

  If you had a low-level reference to ``app.registry`` in your code
  you now need to change this to ``app.config.registry``. Expect more
  changes to this in future versions -- thanks to the dectate library
  we can now start breaking up the big registry into multiple
  independent ones all stored under ``app.config``.

  If you created custom directives, the way to create directives
  is now documented as part of the dectate_ project. The main updates you
  need to do are:

  * subclass from `dectate.Action` instead of `morepath.Directive`.

  * no more ``app`` first argument.

  * no ``super`` call is needed anymore in ``__init__``.

  * add a ``config`` class variable to declare the registries
    you want to affect. Until we break up the main registry this
    is::

      from morepath.app import Registry

      ...
      config = { 'registry': Registry }


  * reverse the arguments to ``perform``, so that the object
    being registered comes first. So change::

      def perform(self, registry, obj):
         ...

    into::

      def perform(self, obj, registry):
         ...

    But instead of ``registry`` use the registry you set up in your
    action's ``config``.

{'fraction_non_alphanumeric': 0.08995611896635787, 'fraction_numerical': 0.0007313505607020966, 'mean_word_length': 2.814504881450488, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '702515', 'n_tokens_mistral': 2326, 'n_tokens_neox': 2167, 'n_words': 972}