pull-request-fixer 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,451 @@
1
+ Metadata-Version: 2.4
2
+ Name: pull-request-fixer
3
+ Version: 0.1.0
4
+ Summary: Pull request formatter and fixer with GitHub integration
5
+ Project-URL: Homepage, https://github.com/lfit/pull-request-fixer
6
+ Project-URL: Repository, https://github.com/lfit/pull-request-fixer.git
7
+ Project-URL: Bug Tracker, https://github.com/lfit/pull-request-fixer/issues
8
+ Author-email: The Linux Foundation <releng@linuxfoundation.org>
9
+ License: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: formatter,github,pr,pre-commit,pull-request
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Classifier: Topic :: Text Processing :: Markup :: Markdown
24
+ Requires-Python: <3.14,>=3.10
25
+ Requires-Dist: aiolimiter>=1.2.0
26
+ Requires-Dist: httpx[http2]>=0.28.0
27
+ Requires-Dist: pydantic>=2.10.3
28
+ Requires-Dist: rich>=13.9.4
29
+ Requires-Dist: tenacity>=9.0.0
30
+ Requires-Dist: typer>=0.15.0
31
+ Provides-Extra: dev
32
+ Requires-Dist: mypy>=1.13.0; extra == 'dev'
33
+ Requires-Dist: pre-commit>=4.0.1; extra == 'dev'
34
+ Requires-Dist: pytest-asyncio>=0.25.0; extra == 'dev'
35
+ Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
36
+ Requires-Dist: pytest-mock>=3.14.0; extra == 'dev'
37
+ Requires-Dist: pytest>=8.3.4; extra == 'dev'
38
+ Requires-Dist: ruff>=0.8.4; extra == 'dev'
39
+ Description-Content-Type: text/markdown
40
+
41
+ <!--
42
+ SPDX-License-Identifier: Apache-2.0
43
+ SPDX-FileCopyrightText: 2025 The Linux Foundation
44
+ -->
45
+
46
+ # 🛠️ Pull Request Fixer
47
+
48
+ A modern Python tool for automatically fixing pull request titles and bodies
49
+ across GitHub organizations. Scans for blocked PRs and updates them based on
50
+ commit messages.
51
+
52
+ ## Features
53
+
54
+ - **🔍 Organization Scanning**: Scan entire GitHub organizations for blocked
55
+ pull requests
56
+ - **✍️ Title Fixing**: Set PR titles to match the first commit's subject line
57
+ - **📝 Body Fixing**: Set PR descriptions to match commit message bodies
58
+ (excluding trailers)
59
+ - **🚀 Parallel Processing**: Process PRs concurrently for
60
+ performance
61
+ - **🔄 Dry Run Mode**: Preview changes before applying them
62
+ - **📊 Progress Tracking**: Real-time progress updates during scanning
63
+ - **🎯 Smart Parsing**: Automatically removes Git trailers (Signed-off-by, etc.)
64
+ - **💬 PR Comments**: Automatically adds a comment to PRs explaining the
65
+ changes made
66
+
67
+ ## Installation
68
+
69
+ ```bash
70
+ pip install pull-request-fixer
71
+ ```
72
+
73
+ Or with uv:
74
+
75
+ ```bash
76
+ uv pip install pull-request-fixer
77
+ ```
78
+
79
+ ## Quick Start
80
+
81
+ ```bash
82
+ # Set your GitHub token
83
+ export GITHUB_TOKEN=ghp_xxxxxxxxxxxxx
84
+
85
+ # Fix PR titles in an organization
86
+ pull-request-fixer lfreleng-actions --fix-title
87
+
88
+ # Fix both titles and bodies
89
+ pull-request-fixer lfreleng-actions --fix-title --fix-body
90
+
91
+ # Preview changes without applying (dry run)
92
+ pull-request-fixer lfreleng-actions --fix-title --fix-body --dry-run
93
+ ```
94
+
95
+ ## Usage
96
+
97
+ ### Basic Command
98
+
99
+ ```bash
100
+ pull-request-fixer ORGANIZATION [OPTIONS]
101
+ ```
102
+
103
+ You can specify the organization as:
104
+
105
+ - Organization name: `myorg`
106
+ - GitHub URL: `https://github.com/myorg`
107
+ - GitHub URL with path: `https://github.com/myorg/`
108
+
109
+ ### Fix Options
110
+
111
+ #### `--fix-title`
112
+
113
+ Updates the PR title to match the first line (subject) of the first commit message.
114
+
115
+ **Example:**
116
+
117
+ If the first commit message is:
118
+
119
+ ```text
120
+ Fix authentication bug in login handler
121
+
122
+ This commit addresses an issue where users couldn't
123
+ log in with special characters in passwords.
124
+
125
+ Signed-off-by: John Doe <john@example.com>
126
+ ```
127
+
128
+ This sets the PR title to:
129
+
130
+ ```text
131
+ Fix authentication bug in login handler
132
+ ```
133
+
134
+ #### `--fix-body`
135
+
136
+ Updates the PR description to match the commit message body, excluding trailers.
137
+
138
+ Using the same commit message above, this sets the PR body to:
139
+
140
+ ```text
141
+ This commit addresses an issue where users couldn't
142
+ log in with special characters in passwords.
143
+ ```
144
+
145
+ The `Signed-off-by:` trailer is automatically removed.
146
+
147
+ ### Common Usage Patterns
148
+
149
+ **Fix titles:**
150
+
151
+ ```bash
152
+ pull-request-fixer myorg --fix-title
153
+ ```
154
+
155
+ **Fix both titles and bodies:**
156
+
157
+ ```bash
158
+ pull-request-fixer myorg --fix-title --fix-body
159
+ ```
160
+
161
+ **Preview changes (dry run):**
162
+
163
+ ```bash
164
+ pull-request-fixer myorg --fix-title --fix-body --dry-run
165
+ ```
166
+
167
+ **Include draft PRs:**
168
+
169
+ ```bash
170
+ pull-request-fixer myorg --fix-title --include-drafts
171
+ ```
172
+
173
+ **Use more workers for large organizations:**
174
+
175
+ ```bash
176
+ pull-request-fixer myorg --fix-title --workers 16
177
+ ```
178
+
179
+ **Quiet mode for automation:**
180
+
181
+ ```bash
182
+ pull-request-fixer myorg --fix-title --quiet
183
+ ```
184
+
185
+ ## PR Comments
186
+
187
+ When the tool applies fixes (not in dry-run mode), it automatically adds a
188
+ comment to the PR explaining the changes. This provides transparency and
189
+ helps PR authors understand the automated modifications.
190
+
191
+ **Example comment:**
192
+
193
+ ```markdown
194
+ ## 🛠️ Pull Request Fixer
195
+
196
+ Automatically fixed pull request metadata:
197
+ - **Pull request title** updated to match first commit
198
+ - **Pull request body** updated to match commit message
199
+
200
+ ---
201
+ *This fix was automatically applied by [pull-request-fixer](https://github.com/lfit/pull-request-fixer)*
202
+ ```
203
+
204
+ The comment includes the items that changed. For
205
+ example, if the title changed, that line will appear in the
206
+ comment.
207
+
208
+ ## Options
209
+
210
+ | Flag | Short | Default | Description |
211
+ |------|-------|---------|-------------|
212
+ | `--token` | `-t` | `$GITHUB_TOKEN` | GitHub personal access token |
213
+ | `--fix-title` | | `false` | Fix PR title to match first commit subject |
214
+ | `--fix-body` | | `false` | Fix PR body to match commit message body |
215
+ | `--include-drafts` | | `false` | Include draft PRs in scan |
216
+ | `--dry-run` | | `false` | Preview changes without applying them |
217
+ | `--workers` | `-j` | `4` | Number of parallel workers (1-32) |
218
+ | `--verbose` | `-v` | `false` | Enable verbose output |
219
+ | `--quiet` | `-q` | `false` | Suppress output except errors |
220
+ | `--log-level` | | `INFO` | Set logging level |
221
+ | `--version` | | | Show version and exit |
222
+ | `--help` | | | Show help message |
223
+
224
+ ## How It Works
225
+
226
+ 1. **Scan Organization**: Uses GitHub's GraphQL API to efficiently find
227
+ blocked pull requests
228
+ 2. **Fetch Commits**: Retrieves the first commit from each PR using the REST
229
+ API
230
+ 3. **Parse Messages**: Extracts commit subject and body, removing trailers
231
+ 4. **Apply Changes**: Updates PR titles and/or bodies in parallel
232
+ 5. **Report Results**: Shows summary of changes made
233
+
234
+ ### Trailers Removed
235
+
236
+ The following Git trailer patterns are automatically removed from PR bodies:
237
+
238
+ - `Signed-off-by:`
239
+ - `Co-authored-by:`
240
+ - `Reviewed-by:`
241
+ - `Tested-by:`
242
+ - `Acked-by:`
243
+ - `Cc:`
244
+ - `Reported-by:`
245
+ - `Suggested-by:`
246
+ - `Fixes:`
247
+ - `See-also:`
248
+ - `Link:`
249
+ - `Bug:`
250
+ - `Change-Id:`
251
+
252
+ ## Authentication
253
+
254
+ You need a GitHub personal access token with appropriate permissions:
255
+
256
+ 1. Go to GitHub Settings → Developer settings → Personal access tokens
257
+ 2. Generate a new token with `repo` scope (or `public_repo` for public repos)
258
+ 3. Set the token as an environment variable:
259
+
260
+ ```bash
261
+ export GITHUB_TOKEN=ghp_xxxxxxxxxxxxx
262
+ ```
263
+
264
+ Or pass it via the `--token` flag:
265
+
266
+ ```bash
267
+ pull-request-fixer myorg --fix-title --token ghp_xxxxxxxxxxxxx
268
+ ```
269
+
270
+ ## Examples
271
+
272
+ ### Example 1: Fix Titles in Organization
273
+
274
+ ```bash
275
+ pull-request-fixer lfreleng-actions --fix-title
276
+ ```
277
+
278
+ Output:
279
+
280
+ ```text
281
+ 🔍 Scanning organization: lfreleng-actions
282
+ 🔧 Will fix: titles
283
+
284
+ 📊 Found 15 blocked PRs to process
285
+
286
+ 🔍 Blocked PRs:
287
+ • lfreleng-actions/repo1#123: Update docs
288
+ • lfreleng-actions/repo2#456: Fix bug
289
+ ...
290
+
291
+ 🔄 Processing: lfreleng-actions/repo1#123
292
+ ✅ Updated title: docs: Add usage examples for CLI
293
+
294
+ 🔄 Processing: lfreleng-actions/repo2#456
295
+ ✅ Updated title: fix: Resolve authentication timeout issue
296
+
297
+ ✅ Fixed 15 PR(s)
298
+ ```
299
+
300
+ ### Example 2: Dry Run with Both Fixes
301
+
302
+ ```bash
303
+ pull-request-fixer myorg --fix-title --fix-body --dry-run
304
+ ```
305
+
306
+ Output:
307
+
308
+ ```text
309
+ 🔍 Scanning organization: myorg
310
+ 🔧 Will fix: titles, bodies
311
+ 🏃 Dry run mode: no changes made
312
+
313
+ 📊 Found 5 blocked PRs to process
314
+
315
+ 🔄 Processing: myorg/repo#123
316
+ Would update title:
317
+ From: Update documentation
318
+ To: docs: Add usage examples for CLI
319
+ Would update body
320
+ Length: 245 chars
321
+
322
+ ✅ [DRY RUN] Would fix 5 PR(s)
323
+ ```
324
+
325
+ ### Example 3: High Performance Mode
326
+
327
+ For large organizations, use more workers:
328
+
329
+ ```bash
330
+ pull-request-fixer bigorg --fix-title --fix-body --workers 16 --verbose
331
+ ```
332
+
333
+ ## Performance
334
+
335
+ - **Parallel Processing**: PRs processed concurrently for speed
336
+ - **Efficient Queries**: GraphQL for scanning, REST for updates
337
+ - **Memory Efficient**: Streaming results, no need to load all PRs
338
+ - **Typical Speed**: 2-5 seconds per repository
339
+
340
+ Example timing for 100 repositories with 50 blocked PRs using 8 workers:
341
+
342
+ - Organization scan: ~30-60 seconds
343
+ - PR processing: ~20-30 seconds
344
+ - **Total: ~50-90 seconds**
345
+
346
+ ## Troubleshooting
347
+
348
+ ### No PRs Found
349
+
350
+ If the tool reports "No blocked PRs found", this could mean:
351
+
352
+ - The organization truly has no blocked PRs
353
+ - You may need to adjust the scanner's definition of "blocked"
354
+
355
+ ### Authentication Errors
356
+
357
+ If you see authentication errors:
358
+
359
+ Make sure your `GITHUB_TOKEN` environment variable contains a valid token
360
+
361
+ - Verify the token has `repo` or `public_repo` scope
362
+ - Check that the token hasn't expired
363
+
364
+ ### Rate Limiting
365
+
366
+ If you hit rate limits:
367
+
368
+ - Reduce the number of workers: `--workers 2`
369
+ - Wait for the rate limit to reset (shown in error message)
370
+ - Use a token with higher rate limits
371
+
372
+ ### Permission Errors
373
+
374
+ If updates fail:
375
+
376
+ - Ensure your token has write access to the repositories
377
+ - Check that you're not trying to update PRs in archived repos
378
+ - Verify the PRs are not locked
379
+
380
+ ## Development
381
+
382
+ ### Setup
383
+
384
+ ```bash
385
+ git clone https://github.com/lfit/pull-request-fixer.git
386
+ cd pull-request-fixer
387
+ uv venv
388
+ source .venv/bin/activate
389
+ uv pip install -e ".[dev]"
390
+ ```
391
+
392
+ ### Running Tests
393
+
394
+ ```bash
395
+ pytest
396
+ ```
397
+
398
+ ### Running Pre-commit Hooks
399
+
400
+ ```bash
401
+ pre-commit install
402
+ pre-commit run --all-files
403
+ ```
404
+
405
+ ### Code Style
406
+
407
+ The project uses:
408
+
409
+ - `ruff` for linting and formatting
410
+ - `mypy` for type checking
411
+ - `pytest` for testing
412
+
413
+ ## Contributing
414
+
415
+ Contributions are welcome! Please:
416
+
417
+ 1. Fork the repository
418
+ 2. Create a feature branch
419
+ 3. Make your changes
420
+ 4. Add tests for new functionality
421
+ 5. Ensure all tests pass
422
+ 6. Submit a pull request
423
+
424
+ ## License
425
+
426
+ Apache-2.0
427
+
428
+ ## Support
429
+
430
+ - **Issues**:
431
+ <https://github.com/lfit/pull-request-fixer/issues>
432
+ - **Documentation**:
433
+ <https://github.com/lfit/pull-request-fixer/blob/main/IMPLEMENTATION.md>
434
+ - **Changelog**:
435
+ <https://github.com/lfit/pull-request-fixer/blob/main/CHANGELOG.md>
436
+
437
+ ## Related Projects
438
+
439
+ - [dependamerge](https://github.com/lfit/dependamerge) - Automatically merge
440
+ automation PRs
441
+ - [markdown-table-fixer](https://github.com/lfit/markdown-table-fixer) - Fix
442
+ markdown table formatting
443
+
444
+ ## Acknowledgments
445
+
446
+ This project uses patterns from:
447
+
448
+ - [dependamerge](https://github.com/lfit/dependamerge) for efficient GitHub
449
+ organization scanning
450
+ - [markdown-table-fixer](https://github.com/lfit/markdown-table-fixer) for
451
+ the initial codebase structure
@@ -0,0 +1,16 @@
1
+ pull_request_fixer/__init__.py,sha256=EhlDWH-Pqxi3WozUigON0O38PRAV7TUYrmx5YSEfeLY,313
2
+ pull_request_fixer/_version.py,sha256=5jwwVncvCiTnhOedfkzzxmxsggwmTBORdFL_4wq0ZeY,704
3
+ pull_request_fixer/cli.py,sha256=vRdZcqAwRGaqu48MWQzU5v20ZDxRtf5X6l7I_K0LC0k,34109
4
+ pull_request_fixer/exceptions.py,sha256=34z6UOuCN3YFSklSZzwV_600x1IWsPuSlmSoAMnfvVM,1287
5
+ pull_request_fixer/github_client.py,sha256=xcKQHfOKsDpCvZI1Tw-v3Bi3OhPlU23gjDO5d_PhYkg,10106
6
+ pull_request_fixer/graphql_queries.py,sha256=IwuP-6gYs1MLeG4UdYyLuF2oXOclbPaIPWyzfXZ-Us8,7284
7
+ pull_request_fixer/models.py,sha256=4v8NhZvkKp3yuT-Ch_75EFkxaxeI42AM9pMdT51jdg8,1411
8
+ pull_request_fixer/pr_fixer.py,sha256=BWXGbdu0wA7cctVflae3w9rSJ1_1h-pNXzkJodZNgbo,1076
9
+ pull_request_fixer/pr_scanner.py,sha256=3W1ZbMO_c-Y69u_Qia5bx_fjf8htcsv7IRHrOjtk03c,15000
10
+ pull_request_fixer/progress_tracker.py,sha256=WWnAsk6UbKFCo-klG5OFVgQ9CSB8StlgeZdS65COhJc,16989
11
+ pull_request_fixer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ pull_request_fixer-0.1.0.dist-info/METADATA,sha256=bawLTPYw_w9yxPPzH1tVCd9drYrPLDopV2JwU6TFy80,11258
13
+ pull_request_fixer-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
14
+ pull_request_fixer-0.1.0.dist-info/entry_points.txt,sha256=MfuicMDNEo8RU_dvlxpymXj1Htk2q_HGmpPju3MnDVw,66
15
+ pull_request_fixer-0.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
16
+ pull_request_fixer-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pull-request-fixer = pull_request_fixer.cli:cli
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.