Skip to content

buildsys: docs: restore clean target - #4474

Open
leleliu008 wants to merge 1 commit into
universal-ctags:masterfrom
leleliu008:fix-docs-clean
Open

buildsys: docs: restore clean target#4474
leleliu008 wants to merge 1 commit into
universal-ctags:masterfrom
leleliu008:fix-docs-clean

Conversation

@leleliu008

@leleliu008 leleliu008 commented Jul 30, 2026

Copy link
Copy Markdown
Member

docs clean target was removed in #4465

We expect that clean target will remove _build/ _ext/__pycache__ directories. sphinx-build -M clean command won't do this.

If users don't want to generate docs, it will fail while executing make clean if sphinx-build is not installed.

It is unreasonable to force users to install Sphinx, as they may have only executed make clean.

@leleliu008
leleliu008 requested a review from masatake July 30, 2026 11:34
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.98%. Comparing base (069715e) to head (d47fc5d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4474   +/-   ##
=======================================
  Coverage   85.98%   85.98%           
=======================================
  Files         255      255           
  Lines       63940    63940           
=======================================
  Hits        54978    54978           
  Misses       8962     8962           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

docs clean target was removed in https://github.com/universal-ctags/ctags/pull/4465/changes

We expect that clean target will remove _build/ _ext/__pycache__ directories. `sphinx-build -M clean` command won't do this.

If users don't want to generate docs, it will fail while executing `make clean` if sphinx-build is not installed.

It is unreasonable to force users to install Sphinx, as they may have only executed `make clean`.
@masatake

masatake commented Jul 30, 2026

Copy link
Copy Markdown
Member

Looks good. However, I want to make changes to the docs/Makefile minimal.

I found a way to externalize your change:

diff --git a/docs/Makefile b/docs/Makefile
index d4bb2cbb9..ba3d446ce 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -18,3 +18,5 @@ help:
 # "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
 %: Makefile
    @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+include ext.mak
diff --git a/docs/ext.mak b/docs/ext.mak
new file mode 100644
index 000000000..69a29f5d3
--- /dev/null
+++ b/docs/ext.mak
@@ -0,0 +1,8 @@
+.PHONY: ext.mak
+
+EXTDIR        = _ext
+
+.PHONY: clean
+
+clean:
+   rm -rf $(BUILDDIR) $(EXTDIR)/__pycache__

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants