Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-34802

Automate enforcement of #pragma once in header files

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Service Arch

      Just under 70 header files fail to issue a  #pragma once directive. We should automate the detection of this in our linting tools.

      $ grep --include="*.h" -IrL '#pragma once' src/mongo
      src/mongo/bson/mutable/mutable_bson_test_utils.h
      src/mongo/transport/message_compressor_noop.h
      src/mongo/transport/message_compressor_zlib.h
      src/mongo/transport/message_compressor_snappy.h
      src/mongo/util/table_formatter.h
      src/mongo/util/quick_exit.h
      src/mongo/util/version.h
      src/mongo/util/md5.h
      src/mongo/util/options_parser/startup_options.h
      src/mongo/util/dns_query_windows-impl.h
      src/mongo/util/dns_query_android-impl.h
      src/mongo/util/dns_query_posix-impl.h
      src/mongo/shell/linenoise.h
      src/mongo/shell/linenoise_utf8.h
      src/mongo/shell/mk_wcwidth.h
      src/mongo/platform/stack_locator.h
      src/mongo/s/database_version_helpers.h
      src/mongo/s/version_mongos.h
      src/mongo/dbtests/framework.h
      src/mongo/gotools/vendor/src/gopkg.in/mgo.v2/internal/sasl/sasl_windows.h
      src/mongo/gotools/vendor/src/gopkg.in/mgo.v2/internal/sasl/sspi_windows.h
      src/mongo/gotools/vendor/src/github.com/10gen/llmgo/internal/sasl/sasl_windows.h
      src/mongo/gotools/vendor/src/github.com/10gen/llmgo/internal/sasl/sspi_windows.h
      src/mongo/gotools/vendor/src/github.com/10gen/openssl/shim.h
      src/mongo/db/ftdc/ftdc_test.h
      src/mongo/db/auth/restriction_mock.h
      src/mongo/db/auth/impersonation_session.h
      src/mongo/db/auth/user_cache_invalidator_job.h
      src/mongo/db/catalog/drop_database.h
      src/mongo/db/catalog/drop_indexes.h
      src/mongo/db/catalog/catalog_control.h
      src/mongo/db/catalog/capped_utils.h
      src/mongo/db/catalog/coll_mod.h
      src/mongo/db/catalog/drop_collection.h
      src/mongo/db/catalog/rename_collection.h
      src/mongo/db/catalog/create_collection.h
      src/mongo/db/repl/do_txn.h
      src/mongo/db/repl/apply_ops.h
      src/mongo/db/repl/mock_repl_coord_server_fixture.h
      src/mongo/db/storage/wiredtiger/wiredtiger_parameters.h
      src/mongo/db/storage/mmap_v1/file_allocator.h
      src/mongo/db/storage/mmap_v1/dur_stats.h
      src/mongo/db/startup_warnings_mongod.h
      src/mongo/db/startup_warnings_common.h
      src/mongo/db/exec/and_common-inl.h
      src/mongo/db/ops/insert.h
      src/mongo/db/commands/copydb_start_commands.h
      src/mongo/db/commands/kill_op_cmd_base.h
      src/mongo/db/commands/shutdown.h
      src/mongo/db/commands/killcursors_common.h
      src/mongo/db/query/parsed_projection.h
      src/mongo/db/query/find_common.h
      src/mongo/db/query/get_executor.h
      src/mongo/db/query/query_planner_test_lib.h
      src/mongo/db/modules/subscription/src/snmp/snmp.h
      src/mongo/db/modules/subscription/src/snmp/serverstatus_client.h
      src/mongo/db/modules/subscription/src/rlp/rlp_language.h
      src/mongo/db/modules/subscription/src/rlp/rlp_options.h
      src/mongo/db/modules/subscription/src/queryable/queryable_wt/blockstore_fs.h
      src/mongo/db/curop_failpoint_helpers.h
      src/mongo/db/stats/fine_clock.h
      src/mongo/db/field_parser-inl.h
      src/mongo/executor/async_stream_common.h
      src/mongo/executor/connection_pool_test_fixture.h
      src/mongo/executor/test_network_connection_hook.h
      src/mongo/client/native_sasl_client_session.h
      src/mongo/client/cyrus_sasl_client_session.h
      src/mongo/client/embedded/libmongodbcapi.h
      src/mongo/client/embedded/embedded_transport_layer.h
      

       

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            schwerin@mongodb.com Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: