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

Rules documentation improvements #2542

Merged
merged 28 commits into from
Feb 3, 2022

Conversation

tunetheweb
Copy link
Member

@tunetheweb tunetheweb commented Feb 2, 2022

Brief summary of the change made

Fixes #2544
Fixes #812
as well as making a host of other changes.

I noticed a couple of things that bugged me with the rules documentation page, and ended up going down the rabbit hole and fixing loads of things. None of them are major, but they bug me!

I have also added a new test to check the @document_configuration decorator is added when there are config options because it was missing in a lot of cases.

Examples of some things I have fixed in this:

Rule L001:

image

Issues:

  • The is not code formatted.
  • The "sqlfluff fix compatible" line looks a bit odd starting with code

New version:

image

Rule L004

image

Issues:

  • Configuration options are in in italics, instead of code formating.
  • Difficult to see how many options (bullet points would be better).
  • Large space after Configuration section
  • Note is not in note block

New version:

image

Rule L007

image

Issues:

  • Config options missing
  • Line breaks in Anti-Pattern/Best Practice description

New version:

image

Rule L009:

image

Issues - scrolling in code block

New version:

image

Are there any other side effects of this change that we should be aware of?

Nope, but lots of changes here!

Pull Request checklist

  • Please confirm you have completed any of the necessary steps below.

  • Included test cases to demonstrate any code changes, which may be one or more of the following:

    • .yml rule test cases in test/fixtures/rules/std_rule_cases.
    • .sql/.yml parser test cases in test/fixtures/dialects (note YML files can be auto generated with tox -e generate-fixture-yml).
    • Full autofix test cases in test/fixtures/linter/autofix.
    • Other.
  • Added appropriate documentation for the change.

  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

docs/source/rules.rst Outdated Show resolved Hide resolved
test/core/rules/docstring_test.py Show resolved Hide resolved
test/core/rules/docstring_test.py Show resolved Hide resolved
test/core/rules/docstring_test.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Feb 2, 2022

Codecov Report

Merging #2542 (439e7d7) into main (8e51ac0) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main     #2542   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          163       163           
  Lines        11771     11781   +10     
=========================================
+ Hits         11771     11781   +10     
Impacted Files Coverage Δ
src/sqlfluff/core/rules/config_info.py 100.00% <ø> (ø)
src/sqlfluff/rules/L001.py 100.00% <ø> (ø)
src/sqlfluff/rules/L002.py 100.00% <ø> (ø)
src/sqlfluff/rules/L003.py 100.00% <ø> (ø)
src/sqlfluff/rules/L004.py 100.00% <ø> (ø)
src/sqlfluff/rules/L005.py 100.00% <ø> (ø)
src/sqlfluff/rules/L006.py 100.00% <ø> (ø)
src/sqlfluff/rules/L008.py 100.00% <ø> (ø)
src/sqlfluff/rules/L009.py 100.00% <ø> (ø)
src/sqlfluff/rules/L010.py 100.00% <ø> (ø)
... and 53 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e51ac0...439e7d7. Read the comment docs.

Copy link
Member

@barrywhart barrywhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went a little crazy reviewing wording myself. 😄

docs/source/rules.rst Outdated Show resolved Hide resolved
src/sqlfluff/rules/L003.py Show resolved Hide resolved
src/sqlfluff/rules/L004.py Outdated Show resolved Hide resolved
src/sqlfluff/rules/L006.py Outdated Show resolved Hide resolved
src/sqlfluff/rules/L007.py Outdated Show resolved Hide resolved
src/sqlfluff/rules/L052.py Outdated Show resolved Hide resolved
src/sqlfluff/rules/L058.py Outdated Show resolved Hide resolved
src/sqlfluff/rules/L059.py Show resolved Hide resolved
src/sqlfluff/rules/L060.py Outdated Show resolved Hide resolved
src/sqlfluff/rules/L061.py Outdated Show resolved Hide resolved
tunetheweb and others added 11 commits February 2, 2022 15:50
Co-authored-by: Barry Hart <barrywhart@yahoo.com>
Co-authored-by: Barry Hart <barrywhart@yahoo.com>
Co-authored-by: Barry Hart <barrywhart@yahoo.com>
Co-authored-by: Barry Hart <barrywhart@yahoo.com>
Co-authored-by: Barry Hart <barrywhart@yahoo.com>
Co-authored-by: Barry Hart <barrywhart@yahoo.com>
Co-authored-by: Barry Hart <barrywhart@yahoo.com>
Co-authored-by: Barry Hart <barrywhart@yahoo.com>
Co-authored-by: Barry Hart <barrywhart@yahoo.com>
@tunetheweb
Copy link
Member Author

Thanks for the very thorough review @barrywhart ! Think I've addressed all the comments.

Copy link
Member

@barrywhart barrywhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks for doing this!

@tunetheweb
Copy link
Member Author

tunetheweb commented Feb 2, 2022

@barrywhart I added some more changes for your old issue as noted here: #812 (comment)

Mind giving those changes a quick once over in case of typos or difficult to understand phrasing?

@tunetheweb
Copy link
Member Author

Ok gave this another read over and am happy with it. Gonna merge as quite a big PR so don’t like leaving those open for merge conflict hell.

@tunetheweb tunetheweb merged commit 7da5c17 into sqlfluff:main Feb 3, 2022
@tunetheweb tunetheweb deleted the rule-docs-improvements branch June 23, 2022 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants