Skip to content

Commit

Permalink
Merge f9ba806 into 6af77c4
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed Jan 13, 2022
2 parents 6af77c4 + f9ba806 commit 30302f1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions docs/configuration.rst
Expand Up @@ -238,3 +238,6 @@ Use ``./`` to indicate the local style:
"https://example.com/on/the/web/remote-style.toml",
"./my-local-style.toml",
]
For Windows users: even though the path separator is a backslash, use the example above as-is.
The "dot-slash" is a convention for Nitpick_ to know this is a local style file.
7 changes: 3 additions & 4 deletions src/nitpick/constants.py
@@ -1,6 +1,4 @@
"""Constants."""
import os

import jmespath

PROJECT_OWNER = "andreoliwa"
Expand Down Expand Up @@ -61,9 +59,10 @@
NITPICK_STYLES_INCLUDE_JMEX = jmespath.compile("nitpick.styles.include")
NITPICK_MINIMUM_VERSION_JMEX = jmespath.compile("nitpick.minimum_version")

#: Dot/slash is used to indicate a local style file
# Dot/slash is just a convention to indicate a local style file;
# the same pair of characters should be used on Windows, even though the path separator is different
DOT = "."
SLASH = os.path.sep
SLASH = "/"
DOT_SLASH = f"{DOT}{SLASH}"

GIT_AT_REFERENCE = "@"
Expand Down
1 change: 0 additions & 1 deletion tests/test_style.py
Expand Up @@ -420,7 +420,6 @@ def test_relative_style_on_urls(tmp_path):


@responses.activate
@XFAIL_ON_WINDOWS
def test_local_style_should_override_settings(tmp_path):
"""Don't build relative URLs from local file names (starting with "./")."""
remote_url = "https://example.com/remote-style.toml"
Expand Down

0 comments on commit 30302f1

Please sign in to comment.