Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused usings. #758

Merged
merged 8 commits into from
Jul 14, 2014
Merged

Conversation

tkirill
Copy link
Contributor

@tkirill tkirill commented Jul 7, 2014

Hi all!

This PR contains not so useful changes but at least this makes my ReSharper happy. 😃

Affects:

  • src\Nest
  • src\Profiling
  • src\Serialization
  • src\Tests

It doesn't affect src\CodeCompletion and src\Elasticsearch.Net because I'm not sure what code is generated and what isn't.

Affect:

* src\Nest
* src\Profiling
* src\Serialization
* src\Tests
@Mpdreamz
Copy link
Member

Mpdreamz commented Jul 7, 2014

Woah thanks @tkirill

Will gladly pull this in but will have to ask you to sign our CLA before I may do so:

http://www.elasticsearch.org/contributor-agreement/

Thanks in advance.

@tkirill
Copy link
Contributor Author

tkirill commented Jul 7, 2014

@Mpdreamz Oh, I completely forgot about this! I'm going to do this right now.

tkirill added 2 commits July 8, 2014 12:34
Conflicts:
	src/Nest/DSL/AnalyzeDescriptor.cs
	src/Nest/DSL/Bulk/BulkUpdateDescriptor.cs
	src/Nest/DSL/BulkDescriptor.cs
	src/Nest/DSL/ClearCacheDescriptor.cs
	src/Nest/DSL/ClearScrollDescriptor.cs
	src/Nest/DSL/CloseIndexDescriptor.cs
	src/Nest/DSL/ClusterHealthDescriptor.cs
	src/Nest/DSL/ClusterStateDescriptor.cs
	src/Nest/DSL/CreateIndexDescriptor.cs
	src/Nest/DSL/DeleteByQueryDescriptor.cs
	src/Nest/DSL/DeleteDescriptor.cs
	src/Nest/DSL/DeleteIndexDescriptor.cs
	src/Nest/DSL/DeleteMappingDescriptor.cs
	src/Nest/DSL/DeleteRepositoryDescriptor.cs
	src/Nest/DSL/DeleteSnapshotDescriptor.cs
	src/Nest/DSL/DeleteTemplateDescriptor.cs
	src/Nest/DSL/DeleteWarmerDescriptor.cs
	src/Nest/DSL/DocumentExistsDescriptor.cs
	src/Nest/DSL/FlushDescriptor.cs
	src/Nest/DSL/GetAliasesDescriptor.cs
	src/Nest/DSL/GetDescriptor.cs
	src/Nest/DSL/GetIndexSettingsDescriptor.cs
	src/Nest/DSL/GetMappingDescriptor.cs
	src/Nest/DSL/GetSnapshotDescriptor.cs
	src/Nest/DSL/GetTemplateDescriptor.cs
	src/Nest/DSL/GetWarmerDescriptor.cs
	src/Nest/DSL/IndexDescriptor.cs
	src/Nest/DSL/IndexExistsDescriptor.cs
	src/Nest/DSL/IndicesStatsDescriptor.cs
	src/Nest/DSL/IndicesStatusDescriptor.cs
	src/Nest/DSL/InfoDescriptor.cs
	src/Nest/DSL/MoreLikeThisDescriptor.cs
	src/Nest/DSL/MultiGet/SimpleGetDescriptor.cs
	src/Nest/DSL/MultiSearchDescriptor.cs
	src/Nest/DSL/NodesInfoDescriptor.cs
	src/Nest/DSL/NodesStatsDescriptor.cs
	src/Nest/DSL/OpenIndexDescriptor.cs
	src/Nest/DSL/OptimizeDescriptor.cs
	src/Nest/DSL/Paths/DocumentOptionalPathDescriptor.cs
	src/Nest/DSL/Paths/DocumentPathDescriptor.cs
	src/Nest/DSL/Paths/FixedIndexTypePathDescriptor.cs
	src/Nest/DSL/Paths/IndexOptionalPathDescriptor.cs
	src/Nest/DSL/Paths/IndexPathDescriptor.cs
	src/Nest/DSL/Paths/IndexTypePathDescriptor.cs
	src/Nest/DSL/Paths/IndexTypePathTypedDescriptor.cs
	src/Nest/DSL/Paths/IndicesOptionalExplicitAllPathDescriptor.cs
	src/Nest/DSL/Paths/IndicesOptionalPathDescriptor.cs
	src/Nest/DSL/Paths/IndicesOptionalTypesNamePathDecriptor.cs
	src/Nest/DSL/Paths/IndicesTypePathDescriptor.cs
	src/Nest/DSL/Paths/NodeIdOptionalDescriptor.cs
	src/Nest/DSL/Paths/QueryPathDescriptor.cs
	src/Nest/DSL/PercolateDescriptor.cs
	src/Nest/DSL/PutMappingDescriptor.cs
	src/Nest/DSL/PutWarmerDescriptor.cs
	src/Nest/DSL/RefreshDescriptor.cs
	src/Nest/DSL/RegisterPercolatorDescriptor.cs
	src/Nest/DSL/Reindex/ReindexDescriptor.cs
	src/Nest/DSL/ScrollDescriptor.cs
	src/Nest/DSL/SegmentsDescriptor.cs
	src/Nest/DSL/SourceDescriptor.cs
	src/Nest/DSL/SuggestDescriptor.cs
	src/Nest/DSL/UnregisterPercolatorDescriptor.cs
	src/Nest/DSL/UpdateDescriptor.cs
	src/Nest/DSL/UpdateSettingsDescriptor.cs
	src/Nest/Domain/Bulk/BaseBulkOperation.cs
	src/Nest/Domain/Responses/BaseResponse.cs
	src/Nest/ElasticClient-DeleteIndex.cs
	src/Nest/ElasticClient-DeleteMany.cs
	src/Nest/ElasticClient-IndicesStats.cs
	src/Nest/ElasticClient-MultiSearch.cs
	src/Nest/ElasticClient-Search.cs
	src/Nest/ElasticClient-State.cs
	src/Nest/ElasticClient.cs
	src/Nest/ExposedInternals/INestSerializer.cs
	src/Tests/Nest.Tests.Integration/Core/Get/GetMultiTests.cs
	src/Tests/Nest.Tests.Integration/Indices/AliasTests.cs
	src/Tests/Nest.Tests.Integration/RawCalls/HasUsefultServerExceptionTests.cs
	src/Tests/Nest.Tests.Integration/Reproduce/Reproduce654Tests.cs
	src/Tests/Nest.Tests.Integration/Reproduce/Reproduce659Tests.cs
	src/Tests/Nest.Tests.Unit/Core/Bulk/BulkTests.cs
	src/Tests/Nest.Tests.Unit/Search/InitializerSyntax/InitializerExample.cs
Conflicts:
	src/Nest/DSL/Facets/DateInterval.cs
	src/Nest/DSL/Query/MatchPhrasePrefixQueryDescriptor.cs
	src/Nest/Domain/Mapping/Descriptors/PropertiesDescriptor.cs
@Mpdreamz
Copy link
Member

Mpdreamz commented Jul 9, 2014

@tkirill @gmarz and discussed this and as is we decided we can't pull it in just yet since it also removes

using System;
using System.Collections.Generic;
using System.Linq;

Which we have set to never remove these in resharper.

tkirill added 3 commits July 10, 2014 23:54
Preserve these usings even if they are not used:

* System
* System.Collections.Generic
* System.Linq

Affect:

    src\Nest
    src\Profiling
    src\Serialization
    src\Tests

It doesn't affect src\CodeGeneration and src\Elasticsearch.Net because I'm not sure what code is generated and what isn't.
@tkirill
Copy link
Contributor Author

tkirill commented Jul 10, 2014

@Mpdreamz OK, I set to never remove these namespaces too and then removed unused usings again. It still doesn't affect src\CodeGeneration and src\Elasticsearch.Net.

I would be grateful if you could explain reasons why do you have these exclusions? I see it for the first time and it is pretty interesting.

@gmarz
Copy link
Contributor

gmarz commented Jul 10, 2014

@tkirill The main reasoning behind leaving those namespaces, especially System, is because they contain many of the basic .NET classes that you would just expect to be there without having to manually add a using for. In the case of NEST, we make heavy use of Linq and generics, so a lot of the time we rely on System.Linq and System.Generic.Colletions already being there. It's just simply for convenience ;).

Thanks for updating your PR, we'll take another look and re-consider pulling it in.

Mpdreamz added a commit that referenced this pull request Jul 14, 2014
@Mpdreamz Mpdreamz merged commit d46a4e2 into elastic:develop Jul 14, 2014
@Mpdreamz
Copy link
Member

Thanks for the PR @tkirill I'm sure this will settle some folks OCD 👍

@tkirill tkirill deleted the feature/unused-usings branch July 15, 2014 03:35
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.

3 participants