Skip to content

Commit

Permalink
Issue 901 (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdewinter authored Jan 17, 2024
1 parent 81304ee commit 139a485
Show file tree
Hide file tree
Showing 59 changed files with 7,788 additions and 28,701 deletions.
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

0 comments on commit 139a485

Please sign in to comment.