Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: abstract limit #268

Merged
merged 5 commits into from
Apr 23, 2024
Merged

Fix: abstract limit #268

merged 5 commits into from
Apr 23, 2024

Conversation

Guts
Copy link
Owner

@Guts Guts commented Apr 22, 2024

Patches sent by mail by @tiosgz. Applied with git am. It's my very first time in this kind of git email workflow. Pfiu !.

Command used:

git am --3way --ignore-space-change v2-0001-fix-retrieving-article-description.patch
git am --3way --ignore-space-change v2-0002-docs-configuration-fix-update-abstract_-chars_cou.patch
git am --3way --ignore-space-change v2-0003-tests-add-test-cases-for-abstract_delimiter.patch

Supersedes #202

cc @craigbox @YDX-2147483647

@github-actions github-actions bot added bug Something isn't working documentation Improvements or additions to documentation quality Tests, project resiliency, etc. labels Apr 22, 2024
@Guts Guts self-assigned this Apr 22, 2024
tiosgz added 4 commits April 22, 2024 23:39
What made me start this change were two logic bugs: chars_count being
checked against -1 (instead of None) and abstract_delimiter taking
higher priority than unlimited chars_count.

Apart from fixing the above, this commit reorders the if-elif chain
according to priority and, in the documentation, mentions how
abstract_chars_count and abstract_delimiter interact.

Breaking changes, as far as i'm aware:
- abstract_chars_count == -1 is again highest-priority,
- more effort (using abstract_delimiter) before non-compliance,
- chars_count is now an inclusive setting, increasing the article length
  before it has to be shortened by one character.
None of these changes conflicts with the pre-existing documentation and
none should be noticeable in a well-configured environment.
The description of abstract_delimiter was obviously wrong, copy-pasted
from abstract_chars_count. Fortunately, even if someone didn't notice
this, setting it to a numeric value erred out, therefore nobody can have
such a working configuration and there's no need to complicate things
trying to accept numbers. The best we can do is document the present
behaviour.

In order to make the interaction of these two settings clear, describe
the full mechanism at once and refer to it from the other place.
One thing not entirely obvious from the changes is that
tests/fixtures/docs/page_without_meta_early_delimiter.md
together with test_simple_build_item_length_unlimited() checks the
priority of abstract_chars_count: -1 versus abstract_delimiter.
@Guts Guts force-pushed the fix/abstract-limit branch from 2cafc3c to e78ec88 Compare April 22, 2024 21:39
Copy link

codecov bot commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 84.68%. Comparing base (a08052a) to head (e78ec88).

❗ Current head e78ec88 differs from pull request most recent head d81039d. Consider uploading reports for the commit d81039d to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #268      +/-   ##
==========================================
+ Coverage   84.22%   84.68%   +0.45%     
==========================================
  Files          10       10              
  Lines         558      555       -3     
  Branches      119      117       -2     
==========================================
  Hits          470      470              
+ Misses         56       54       -2     
+ Partials       32       31       -1     
Flag Coverage Δ
unittests 84.50% <50.00%> (+0.45%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
mkdocs_rss_plugin/util.py 75.20% <50.00%> (+0.90%) ⬆️

Co-authored-by: Y.D.X. <[email protected]>
Signed-off-by: Julien <[email protected]>
@Guts Guts enabled auto-merge April 23, 2024 17:52
@Guts Guts merged commit 0fb63da into main Apr 23, 2024
9 checks passed
@Guts Guts deleted the fix/abstract-limit branch April 23, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation quality Tests, project resiliency, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants