plain.code 0.0.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plain.code
3
- Version: 0.0.0
4
- Summary:
3
+ Version: 0.2.0
4
+ Summary: Code formatting and linting for Plain.
5
5
  Author: Dave Gaeddert
6
6
  Author-email: dave.gaeddert@dropseed.dev
7
- Requires-Python: >=3.8,<4.0
7
+ Requires-Python: >=3.11,<4.0
8
8
  Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.8
10
- Classifier: Programming Language :: Python :: 3.9
11
- Classifier: Programming Language :: Python :: 3.10
12
9
  Classifier: Programming Language :: Python :: 3.11
13
10
  Classifier: Programming Language :: Python :: 3.12
14
11
  Requires-Dist: ruff (>=0.1.0,<0.2.0)
@@ -40,15 +40,22 @@ def check(path):
40
40
 
41
41
  @cli.command()
42
42
  @click.argument("path", default=".")
43
- def fix(path):
43
+ @click.option("--unsafe-fixes", is_flag=True, help="Apply ruff unsafe fixes")
44
+ def fix(path, unsafe_fixes):
44
45
  """Lint and format the given path."""
45
46
  ruff_args = ["--config", str(DEFAULT_RUFF_CONFIG)]
46
47
 
47
48
  for e in get_code_config().get("exclude", []):
48
49
  ruff_args.extend(["--exclude", e])
49
50
 
50
- print_event("Ruff check")
51
- result = subprocess.run(["ruff", "check", path, "--fix", *ruff_args])
51
+ if unsafe_fixes:
52
+ print_event("Ruff fix (with unsafe fixes)")
53
+ result = subprocess.run(
54
+ ["ruff", "check", path, "--fix", "--unsafe-fixes", *ruff_args]
55
+ )
56
+ else:
57
+ print_event("Ruff fix")
58
+ result = subprocess.run(["ruff", "check", path, "--fix", *ruff_args])
52
59
 
53
60
  if result.returncode != 0:
54
61
  sys.exit(result.returncode)
@@ -4,8 +4,8 @@ packages = [
4
4
  { include = "plain" },
5
5
  ]
6
6
 
7
- version = "0.0.0"
8
- description = ""
7
+ version = "0.2.0"
8
+ description = "Code formatting and linting for Plain."
9
9
  authors = ["Dave Gaeddert <dave.gaeddert@dropseed.dev>"]
10
10
 
11
11
  # Make the CLI available without adding to INSTALLED_APPS
@@ -14,7 +14,7 @@ authors = ["Dave Gaeddert <dave.gaeddert@dropseed.dev>"]
14
14
  "fix" = "plain.code.cli:fix"
15
15
 
16
16
  [tool.poetry.dependencies]
17
- python = "^3.8"
17
+ python = "^3.11"
18
18
  ruff = "^0.1.0"
19
19
 
20
20
  [tool.poetry.dev-dependencies]
File without changes