Skip to content

Commit

Permalink
Flow-ignore .hg directory (#1412)
Browse files Browse the repository at this point in the history
Summary:
When using Sapling in an OSS checkout, Flow does not ignore files under `.hg`, leading to false errors especially in Sapling's `origbackups`, which may contain old versions of files, complete with `// flow` comments, out of context.

Changelog: Internal

Pull Request resolved: #1412

Test Plan:
## Before
```
yarn flow ls | grep '\.hg'
/Users/robhogan/workspace/metro-sl/.hg/runlog/41hxy19HHF6cGBn491508.json
/Users/robhogan/workspace/metro-sl/.hg/runlog/37Z4u1Env4S8RkEa44097.json
<...>
/Users/robhogan/workspace/metro-sl/.hg/origbackups/packages/metro-file-map/src/watchers/common.js
/Users/robhogan/workspace/metro-sl/.hg/origbackups/packages/metro-file-map/src/watchers/FSEventsWatcher.js
```

```
yarn flow ls | wc -l
   25908
```

```
yarn flow
yarn run v1.22.22
$ /Users/robhogan/workspace/metro-sl/node_modules/.bin/flow
Debugger attached.
Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ .hg/origbackups/packages/metro-file-map/src/watchers/FSEventsWatcher.js:157:18

Private fields must be declared before they can be referenced. #root has not been declared.

     154β”‚   _emit(payload: Omit<WatcherBackendChangeEvent, 'root'>) {
     155β”‚     this.emit(ALL_EVENT, {
     156β”‚       ...payload,
     157β”‚       root: this.#root,
     158β”‚     } as WatcherBackendChangeEvent);
     159β”‚   }
     160β”‚
```

## After
```
yarn flow ls | grep '\.hg'
<empty response>
```

```
yarn flow ls | wc -l
   25861
```

```
yarn flow
yarn run v1.22.22
$ /Users/robhogan/workspace/metro-sl/node_modules/.bin/flow
No errors!
```

Reviewed By: hoxyq

Differential Revision: D67562554

Pulled By: robhogan

fbshipit-source-id: 2989914d64296643f3e27c8d3c55bc6278d883fd
  • Loading branch information
robhogan authored and facebook-github-bot committed Dec 23, 2024
1 parent c25f770 commit d0e630b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[ignore]
<PROJECT_ROOT>/packages/.*/build/.*
<PROJECT_ROOT>/\.hg/.*
# this transient dep bundles tests with their package, which flow attempts to parse
# and crashes out as the test includes purposely malformed json
<PROJECT_ROOT>\(/.*\)?/node_modules/resolve/test/.*
Expand Down

0 comments on commit d0e630b

Please sign in to comment.