@@ -175,3 +175,65 @@ Configuration at * (glob)
175175* (glob+)
176176[0]
177177```
178+
179+ ## We'll use the first marker file we find as a project root
180+
181+ ``` scrut {output_stream: stdout}
182+ $ mkdir -p $TMPDIR/config_finder/project && \
183+ > touch $TMPDIR/config_finder/pyproject.toml && \
184+ > touch $TMPDIR/config_finder/project/pyproject.toml && \
185+ > touch $TMPDIR/config_finder/project/main.py && \
186+ > $PYREFLY dump-config $TMPDIR/config_finder/project/main.py
187+ Default configuration for project root marked by `*/config_finder/project/pyproject.toml` (glob)
188+ * (glob+)
189+ [0]
190+ ```
191+
192+ ## We'll prefer a Pyrefly config in a parent directory to a marker file
193+
194+ <!-- Reusing configs set up in tests between here and "We'll use the first marker file we find as a project root" -->
195+
196+ ``` scrut {output_stream: stdout}
197+ $ touch $TMPDIR/config_finder/pyrefly.toml && \
198+ > $PYREFLY dump-config $TMPDIR/config_finder/project/main.py
199+ Configuration at `*/config_finder/pyrefly.toml` (glob)
200+ * (glob+)
201+ [0]
202+ ```
203+
204+ ## We'll prefer a Pyproject with Pyrefly config in a parent directory to a marker file
205+
206+ <!-- Reusing configs set up in tests between here and "We'll use the first marker file we find as a project root" -->
207+
208+ ``` scrut {output_stream: stdout}
209+ $ rm $TMPDIR/config_finder/pyrefly.toml && \
210+ > echo "[tool.pyrefly]" > $TMPDIR/config_finder/pyproject.toml && \
211+ > $PYREFLY dump-config $TMPDIR/config_finder/project/main.py
212+ Configuration at `*/config_finder/pyproject.toml` (glob)
213+ * (glob+)
214+ [0]
215+ ```
216+
217+ ## We'll use the first Pyrefly config we find
218+
219+ <!-- Reusing configs set up in tests between here and "We'll use the first marker file we find as a project root" -->
220+
221+ ``` scrut {output_stream: stdout}
222+ $ echo "[tool.pyrefly]" > $TMPDIR/config_finder/project/pyproject.toml && \
223+ > $PYREFLY dump-config $TMPDIR/config_finder/project/main.py
224+ Configuration at `*/config_finder/project/pyproject.toml` (glob)
225+ * (glob+)
226+ [0]
227+ ```
228+
229+ ## We'll prefer pyrefly.toml to pyproject.toml
230+
231+ <!-- Reusing configs set up in tests between here and "We'll use the first marker file we find as a project root" -->
232+
233+ ``` scrut {output_stream: stdout}
234+ $ touch $TMPDIR/config_finder/project/pyrefly.toml && \
235+ > $PYREFLY dump-config $TMPDIR/config_finder/project/main.py
236+ Configuration at `*/config_finder/project/pyrefly.toml` (glob)
237+ * (glob+)
238+ [0]
239+ ```
0 commit comments