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

Issue 901 #949

Merged
merged 54 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
03b9741
https://github.com/jackdewinter/pymarkdown/issues/901
jackdewinter Dec 9, 2023
16278fb
https://github.com/jackdewinter/pymarkdown/issues/803
jackdewinter Dec 9, 2023
96690f2
https://github.com/jackdewinter/pymarkdown/issues/802
jackdewinter Dec 16, 2023
01c3640
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 16, 2023
6da9683
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 17, 2023
70fc8f2
https://github.com/jackdewinter/pymarkdown/issues/913
jackdewinter Dec 17, 2023
a4a61db
https://github.com/jackdewinter/pymarkdown/issues/825
jackdewinter Dec 17, 2023
4c2bf4e
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 17, 2023
e7f4a9d
https://github.com/jackdewinter/pymarkdown/issues/823
jackdewinter Dec 17, 2023
30e0cc7
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 17, 2023
d5bfba7
https://github.com/jackdewinter/pymarkdown/issues/822
jackdewinter Dec 18, 2023
429ed4e
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 18, 2023
ef6efd4
https://github.com/jackdewinter/pymarkdown/issues/821
jackdewinter Dec 18, 2023
7807b69
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 18, 2023
153b0f9
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 18, 2023
0a2ba80
https://github.com/jackdewinter/pymarkdown/issues/820
jackdewinter Dec 19, 2023
95addd1
https://github.com/jackdewinter/pymarkdown/issues/820
jackdewinter Dec 19, 2023
2e01ecc
https://github.com/jackdewinter/pymarkdown/issues/817
jackdewinter Dec 20, 2023
2c88e16
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 20, 2023
2a280e7
https://github.com/jackdewinter/pymarkdown/issues/816
jackdewinter Dec 22, 2023
d5124df
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 22, 2023
1c539de
https://github.com/jackdewinter/pymarkdown/issues/814
jackdewinter Dec 22, 2023
79d0de5
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 22, 2023
a80ae0c
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 22, 2023
7adb3ff
https://github.com/jackdewinter/pymarkdown/issues/813
jackdewinter Dec 22, 2023
8b84c9d
https://github.com/jackdewinter/pymarkdown/issues/809
jackdewinter Dec 27, 2023
b8e6aaf
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 27, 2023
059c541
https://github.com/jackdewinter/pymarkdown/issues/808
jackdewinter Dec 27, 2023
43c5d93
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 27, 2023
b724da8
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 27, 2023
60a2a55
https://github.com/jackdewinter/pymarkdown/issues/812
jackdewinter Dec 27, 2023
3d9aaa6
https://github.com/jackdewinter/pymarkdown/issues/931
jackdewinter Dec 30, 2023
26ffe88
https://github.com/jackdewinter/pymarkdown/issues/931
jackdewinter Dec 30, 2023
ff3e23a
https://github.com/jackdewinter/pymarkdown/issues/931
jackdewinter Dec 30, 2023
4d3c0d7
https://github.com/jackdewinter/pymarkdown/issues/931
jackdewinter Dec 30, 2023
02b2899
https://github.com/jackdewinter/pymarkdown/issues/934
jackdewinter Dec 30, 2023
4a13220
https://github.com/jackdewinter/pymarkdown/issues/936
jackdewinter Dec 30, 2023
9ffb19c
https://github.com/jackdewinter/pymarkdown/issues/936
jackdewinter Dec 30, 2023
756638d
https://github.com/jackdewinter/pymarkdown/issues/938
jackdewinter Dec 31, 2023
f1cdd18
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 31, 2023
98dda99
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Dec 31, 2023
28694d7
https://github.com/jackdewinter/pymarkdown/issues/940
jackdewinter Dec 31, 2023
fc67494
https://github.com/jackdewinter/pymarkdown/issues/940
jackdewinter Dec 31, 2023
9f806b0
https://github.com/jackdewinter/pymarkdown/issues/941
jackdewinter Jan 1, 2024
9b86f06
https://github.com/jackdewinter/pymarkdown/issues/941
jackdewinter Jan 1, 2024
84deabf
https://github.com/jackdewinter/pymarkdown/issues/827
jackdewinter Jan 1, 2024
d42f213
https://github.com/jackdewinter/pymarkdown/issues/944
jackdewinter Jan 1, 2024
0c49bbc
next batch
jackdewinter Jan 7, 2024
2a2e588
after first major pass
jackdewinter Jan 7, 2024
a45ea47
removed non-needed disabled
jackdewinter Jan 8, 2024
ce8016e
adding MD030 and cleaning up
jackdewinter Jan 9, 2024
6e90a4c
phase two
jackdewinter Jan 14, 2024
2603993
https://github.com/jackdewinter/pymarkdown/issues/827
jackdewinter Jan 16, 2024
3e36646
Merge branch 'main' of https://github.com/jackdewinter/pymarkdown int…
jackdewinter Jan 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
## Unversioned - In Main, Not Released

This release is going to focus on getting the feature list complete
for a version 1.0 release in early 2024.
for a version 1.0 release in early 2024. To a large extent, this
involves adding the "fix" feature for some rules, and double checking
the output of many of the existing rules, looking for missing issues.

### Added

Expand Down Expand Up @@ -46,8 +48,12 @@ for a version 1.0 release in early 2024.

### Changed

- [Issue 806](https://github.com/jackdewinter/pymarkdown/issues/806)
- Documentation updated to denote fixes.
- [Issue 812](https://github.com/jackdewinter/pymarkdown/issues/812)
- Rule MD014 - Changed documentation to describe why not autofix
- [Issue 827](https://github.com/jackdewinter/pymarkdown/issues/827)
- Finished research on which rules are fixable and sorted.
- [Issue 901](https://github.com/jackdewinter/pymarkdown/issues/901)
- noticed cases where `len(x)` was being used instead of `x` or `not x`
- [Issue 913](https://github.com/jackdewinter/pymarkdown/issues/913)
Expand All @@ -66,6 +72,13 @@ for a version 1.0 release in early 2024.

- None

### Completed

- [Issue 827](https://github.com/jackdewinter/pymarkdown/issues/827)
- researched annotated each rule
- rules "in queue" have no annotation yet, ones that have fixes have docs
updated, ones that are not eligible have reason why

## Version 0.9.15 - Date: 2023-12-05

This release is mainly to fix issues related to technical debt. The PyMarkdown
Expand Down
70 changes: 68 additions & 2 deletions docs/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,73 @@ report_next_line_error

completed_file

## Fix Conflict Checks

MD001 & md003 - Md003 is not fixable
MD004 & md006 - `mix_md004_md006` - duplicate of inverse - disabled by default
& md007 - `mix_md004_md007` - check
& md032 - `mix_md004_md032` - future
MD005 & md007 `mix_md005_md007`
& md023 - from below
& md027 - `mix_md005_md007`
& md029 - `mix_md005_md029`
& md030 - `mix_md005_md030`
& md033 - safe
MD007 & md004 - `mix_md007_md004`
& md005 - `mix_md007_md005`
& md027 - `mix_md007_md027`
& md030 - `mix_md007_md030`
md009 & md012 - future
& md023 - `mix_md009_md023` - check -> 009, 0027, 023
& md027 - `mix_md009_md027` - duplicate of inverse
& md033 - future
MD010 & md019 - `mix_md010_md019` - duplicate of inverse
& md021 - `mix_md010_md021` - duplicate of inverse
& md022 - safe
& md030 - `mix_md010_md030`
& md031 - safe
& md040 - safe
& md047 - `mix_md010_md047`
MD019 & md010 - `mix_md019_md010` - duplicate of inverse
& md023 - `mix_md019_md023` - check
& md047 - `mix_md019_md047` - double check, not required
MD021 & md010 - `mix_md021_md010` - check
MD023 & md005 - up
& md009 - `mix_md023_md009` - duplicate of inverse
& md019 - `mix_md023_md019` - duplicate of inverse
& md022 - safe
& md027 - `mix_md023_md027`
& md030 - `mix_md023_md030`
& md032 - safe
MD027 & md003 - safe
& md005 - `mix_md027_md005`
& md007 - `mix_md027_md007` - check
& md009 - `mix_md027_md009`
& md012 - safe
& md013 - safe
& md022 - safe
& md023 - `mix_md027_md023`
& md028 - safe
& md030 - `mix_md027_md030`
& md031 - safe
& md032 - safe
MD029 & md030 - `mix_md029_md005`
MD030 & md005 - `mix_md030_md005`
& md007 - `mix_md030_md007` - check
& md010 - `mix_md030_md010`
& md027 - `mix_md030_md027`
& md030 - `mix_md030_md023`
MD035 - none
MD037 - none
MD039 - none
MD047 & md010 - `mix_md047_md010` - double check
& md019 - `mix_md047_md019` - double check
MD048 - none

MD006 & md004 - `mix_md006_md004` up (disabled by default)
md007 (disabled by default)
md027 (disabled by default)

possible -> MD005, Md007
possible -> MD019/MD021, MD023
possible -> md027 19/21/23/05/07 when blanks inside of list
Expand All @@ -158,6 +225,7 @@ MD019 AtxHeadingMarkdownToken extracted_whitespace
MD021 AtxHeadingMarkdownToken extracted_whitespace, extra_end_data
MD023 AtxHeadingMarkdownToken extracted_whitespace
MD029 OrderedListStartMarkdownToken list_start_content
md030 spaces after list markers, def = 1
MD035 ThematicBreakMarkdownToken start_character,rest_of_line
MD037 TextMarkdownToken (within emphasis) token_text
MD038 InlineCodeSpanMarkdownToken span_text
Expand All @@ -177,5 +245,3 @@ MD027 BlankLineMarkdownToken extracted_whitespace
NewListItemMarkdownToken indent_level, extracted_whitespace
UnorderedListStartMarkdownToken indent_level, extracted_whitespace, column_number, leading_spaces
OrderedListStartMarkdownToken indent_level, extracted_whitespace, column_number, leading_spaces

md030 spaces after list markers, def = 1
47 changes: 46 additions & 1 deletion docs/rules.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,49 @@
# Implemented Rules
# Plugin Rules

Plugins are the manner in which rules are included into PyMarkdown. While there
are a healthy set of rules shipped with PyMarkdown, there is also support for any
user to provide their own plugins.

Each shipped plugins comes completed with its own documentation. This documentation
follows this format.

- Title and High Level Information
- The name of the rule, any aliases for the rule, and whether the autofix option
is available for this rule.
- Deprecation
- If this plugin is deprecated in favor of another plugin, what that other plugin
is.
- Summary
- A quick one line summary of what the rule does.
- Reasoning
- Why this rule was implemented.
- Readability, Consistency, Simplicity, Correctness, Portability
- Examples
- Both positive and negative examples to illustrate the rule. Since the rule
triggers on negative examples, the negative examples are usually first, often
with the corrected positive for of the examples following them.
- Configuration
- Two tables to present that configuration, even if the only configuration is
the `enabled` value. The first table shows acceptable prefixes for any configuration
value and the second table lists the value's name, its type, its default value,
and a simple description of the configuration.
- Origination of Rule
- A compliment to the `Reasoning` section, this section talks about the history
of the rule.
- Fix Description
- If autofix is available for the rule, what the effects of using autofix are.
- If autofix is not available for the rule, why the decision to not autofix was
made.
- If this section is not present, it means that the rule is currently in queue
for adding autofix support.

A big note on the Fix Description for any plugin that does not support autofix.
That section contains the reasons why the decision was made at the time. Given
extra conversation and a solid, predictable algorithm to apply, it is possible to
change that decision. If you believe that you have a solution, please file an
issue and present your case to our team!

## Implemented Rules

These are the rules that are currently implemented.

Expand Down
2 changes: 2 additions & 0 deletions docs/rules/rule_md009.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Trailing spaces.

## Reasoning

### Simplicity

The primary reason for enabling this rule is simplicity. Two spaces at
the end of a line within a paragraph produces a Hard Line Break element.
Other than that, there is no other reason for trailing spaces on any line
Expand Down
10 changes: 10 additions & 0 deletions docs/rules/rule_md030.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
| `md030` |
| `list-marker-space` |

| Autofix Available |
| --- |
| Yes |

## Summary

Spaces after list markers.
Expand Down Expand Up @@ -81,3 +85,9 @@ to trigger this rule:

This rule is largely inspired by the MarkdownLint rule
[MD030](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md030---spaces-after-list-markers).

## Fix Description

When fixed, the number of spaces between a list start and the following text are
set to the configured spacing. By default, this means ordered and unordered list
start sequences will be set to have 1 space before the text.
8 changes: 4 additions & 4 deletions publish/coverage.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"projectName": "pymarkdown",
"reportSource": "pytest",
"branchLevel": {
"totalMeasured": 4699,
"totalCovered": 4699
"totalMeasured": 4761,
"totalCovered": 4761
},
"lineLevel": {
"totalMeasured": 19151,
"totalCovered": 19151
"totalMeasured": 19275,
"totalCovered": 19275
}
}

12 changes: 7 additions & 5 deletions publish/pylint_suppression.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@
"protected-access": 1
},
"pymarkdown/file_scan_helper.py": {
"too-many-arguments": 5
"too-many-arguments": 8,
"too-many-locals": 4
},
"pymarkdown/general/__init__.py": {},
"pymarkdown/general/bad_tokenization_error.py": {},
Expand Down Expand Up @@ -255,7 +256,8 @@
},
"pymarkdown/plugin_manager/plugin_manager.py": {
"too-many-instance-attributes": 1,
"too-many-arguments": 3
"too-many-arguments": 4,
"too-many-locals": 1
},
"pymarkdown/plugin_manager/plugin_modify_context.py": {
"deprecated-decorator": 2
Expand Down Expand Up @@ -305,7 +307,7 @@
"pymarkdown/plugins/rule_md_026.py": {},
"pymarkdown/plugins/rule_md_027.py": {
"too-many-instance-attributes": 1,
"too-many-arguments": 4
"too-many-arguments": 6
},
"pymarkdown/plugins/rule_md_028.py": {},
"pymarkdown/plugins/rule_md_029.py": {},
Expand Down Expand Up @@ -491,8 +493,8 @@
"too-many-instance-attributes": 24,
"too-many-public-methods": 4,
"too-few-public-methods": 39,
"too-many-arguments": 220,
"too-many-locals": 33,
"too-many-arguments": 226,
"too-many-locals": 38,
"chained-comparison": 1,
"too-many-boolean-expressions": 2,
"protected-access": 26,
Expand Down
Loading
Loading